Code reference from the book by wrox: Professional PHP 4:
I am trying to get the statement
$this->msg_no = $GLOBALS["msg_no"];
to work within my function which resides in a class. My error statement is the following:
Notice: Undefined index: msg_no in C:\Apache2\htdocs\_development\webmail\webmail2.php on line 46
The catch is that my server online works fine.
MY SETUP:
WORKSTATION SETUP: WAMP(win2k, apache 2.0.43, mysql, PHP 4.2.4 dev).
SERVER SETUP: FreeBSD, PHP 4.2.2
Question: Is this a linux specific statment? or is there a setting on my workstation that I need to fix?
Using $GLOBALS in a function within a class
Moderator: General Moderators
afaik there are no settings for having $GLOBALS or not.
You're sure your script runs exactly the same way on the server and on your workstation?
tryright before $this->msg_no = $GLOBALS["msg_no"]; and check wether the value is in the array or not.
You're sure your script runs exactly the same way on the server and on your workstation?
try
Code: Select all
echo '<!--'; print_r($GLOBALS); echo '-->';