This is the problem:
When I create a class, I'm not able to access the global variables. For example in the following code:
<?php
class MyClass {
function return_address() {
return $REMOTE_ADDR;
}
}
$myObj = new MyClass();
print $myObj->return_address();
?>
I don't get any output. For some reason the function inside the class is not able to access the environment variable. The same problem also persists with form value. If I passed a value like username=sridhar, then when I try to access $username from within MyClass, then the value returns as an empty string (NULL).
Can anyone suggest a solution? (Please feel free to contact me via e-mail if you wish not to reply this message).
Thanks,
Sridhar