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.
|
|
|
|