CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Write funcion's result on a page (PHP)

Print topic Send  topic

Author Message
gsouza
Posted: 08/09/2002, 9:41 AM

I need to execute a PHP function and write the result on the page. In Code Charge Pro I could define a label, execute the function and assign the result to $fldLabelName on "Before Show" event, but how can I do it on Code Charge Studio ? What event should I use ? What is the variable's name ?

Thanks in advance
Nicole
Posted: 08/10/2002, 3:46 AM

Hello,
put the custom function body into common.php file.
Add Label type field to the form or page, create Before Show event for this label. To assign it custom value use code like:
- for the field on the form:
global $form_name;
$form_name->field_name->SetValue("custom_val");
- for the field on the page (located outside form):
global $label_name;
$label_name->SetValue("any value");
kangus
Posted: 08/10/2002, 6:26 PM

Nicole, your suggestion to place the function into the common.php file is a little confusing. Adding the custom code before show works but the minute I add:
function NumDaysLeft($futureDate){
return $DaysTillElection=(date("z",strtotime ($futureDate))-(Date("z")));
to the common.php file then add:
global $DaysLeft;
$DaysTillElection=NumDaysLeft("5 November 2002");
$DaysLeft->SetValue("Number of days left until the ELECTION is: ".$DaysTillElection);
to the Custom Code of the DaysLeft Label everything blows up.
Can not find the function.....

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.