Reserved variables not working

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
BV
-


Joined: 03 Apr 2003
Posts: 2
Location: Eastbourne, East-Sussex, England

PostPosted: Thu Apr 03, 2003 10:52 pm    Post subject: Reserved variables not working Reply with quote

whenever i try to use one of the reserved variables, like
Code:
$PHP_SELF
or
Code:
$_POST
it says undefined variable...
how do i fix this?
Back to top View user's profile Send private message Send e-mail AIM Address MSN Messenger
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Apr 04, 2003 2:13 pm    Post subject: Re: Reserved variables not working Reply with quote

BV wrote:
whenever i try to use one of the reserved variables, like
Code:
$PHP_SELF
or
Code:
$_POST
it says undefined variable...
how do i fix this?

You should use $_SERVER['PHP_SELF'] instead. Read the PHP manual for the new PHP variables naming conventions.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
BV
-


Joined: 03 Apr 2003
Posts: 2
Location: Eastbourne, East-Sussex, England

PostPosted: Fri Apr 04, 2003 11:44 pm    Post subject: Reply with quote

ok, thanx

and, if i wanted to make it so i could use variables such as $PHP_SELF, then could i go into the cgi parameters page, and set PHP_SELF as a variable, and put $_SERVER['PHP_SELF'] as the value, then i could just use $PHP_SELF?
Back to top View user's profile Send private message Send e-mail AIM Address MSN Messenger
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Apr 05, 2003 12:56 am    Post subject: Reply with quote

BV wrote:
ok, thanx

and, if i wanted to make it so i could use variables such as $PHP_SELF, then could i go into the cgi parameters page, and set PHP_SELF as a variable, and put $_SERVER['PHP_SELF'] as the value, then i could just use $PHP_SELF?

No, that has no meaning when you do so. If you want to use PHP_SELF as in the old days of PHP, you should edit php.ini, locate the line:
register_gloabls=off
and change it to:
register_gloabls=on

That way, you can use $PHP_SELF instead of $_SERVER['PHP_SELF'] .
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group