CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Why does "SetValue" on include page not work?

Print topic Send  topic

Author Message
Headhunter
Posted: 11/30/2003, 12:32 PM

CCS2, php, mysql

I have a page counter that stores counts in a database.
On my grid I have a before show row event like this:
//Begin

global $hit_counter;

$hit_counter->hits->SetValue(str_replace(0, "<img src='images/counter/0.jpg'>", $hit_counter->hits->GetValue()));
$hit_counter->hits->SetValue(str_replace(1, "<img src='images/counter/1.jpg'>", $hit_counter->hits->GetValue()));
$hit_counter->hits->SetValue(str_replace(2, "<img src='images/counter/2.jpg'>", $hit_counter->hits->GetValue()));
$hit_counter->hits->SetValue(str_replace(3, "<img src='images/counter/3.jpg'>", $hit_counter->hits->GetValue()));
$hit_counter->hits->SetValue(str_replace(4, "<img src='images/counter/4.jpg'>", $hit_counter->hits->GetValue()));
$hit_counter->hits->SetValue(str_replace(5, "<img src='images/counter/5.jpg'>", $hit_counter->hits->GetValue()));
$hit_counter->hits->SetValue(str_replace(6, "<img src='images/counter/6.jpg'>", $hit_counter->hits->GetValue()));
$hit_counter->hits->SetValue(str_replace(7, "<img src='images/counter/7.jpg'>", $hit_counter->hits->GetValue()));
$hit_counter->hits->SetValue(str_replace(8, "<img src='images/counter/8.jpg'>", $hit_counter->hits->GetValue()));
$hit_counter->hits->SetValue(str_replace(9, "<img src='images/counter/9.jpg'>", $hit_counter->hits->GetValue()));
//End

It works on a normal page but when I put this in an include page it doesn't work anymore. I get:

Fatal error: Call to a member function on a non-object in /var/www/html/geeco/adds_events.php on line 15

adds.php is a include page included in my normal page main.php

Thanks in advance
Neal
Posted: 11/30/2003, 2:51 PM

You have to include a reference to the include page when dealing with controls that reside in the include page as in:

$includepage->formname->controlname->SetValue();

Refer to the Referencing Objects section of the online docs to see examples.


   


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

Web Database

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.