SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Thread: Undefined variable: PHP_SELF
-
May 30, 2003, 17:04 #1
Undefined variable: PHP_SELF
I have just set up a new computer. This time with Apache 2 replacing IIS. I moved all the .php and .inc files from wwwroot to htdocs.
Now when presenting a form I get the Undefined variable: PHP_SELF error. It allows the rest of the page to load just fine but the text box values seem to get lost.
Is this a .cfg or .ini issue?
TIA, Zed
-
May 30, 2003, 17:56 #2
- Join Date
- Jan 2003
- Location
- Calgary, Canada
- Posts
- 2,063
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This is most likely a register_globals issue.
You'll need to replace $PHP_SELF with $_SERVER['PHP_SELF'] in your PHP files.
or goPHP Code:$PHP_SELF = $_SERVER['PHP_SELF'];
Who walks the stairs without a care
It shoots so high in the sky.
Bounce up and down just like a clown.
Everyone knows its Slinky.
-
Jun 1, 2003, 08:30 #3
Sure enough, register_globals was set to Off. Once set to on the .php files work just as before.
Thanks cyborg.
OOOOOOOOOOO <= Some donuts for ya.
-
Jun 2, 2003, 12:38 #4
- Join Date
- Oct 2002
- Location
- Utah (USA)
- Posts
- 309
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
BTW, register globals was set to off by default for a reason. Might want to look into that a little bit before you go too far coding with it turned back on.
[edit] Err... I just realized you already did some coding with it on then did a new Apache/PHP installation and it was off by default, so you've switched it back to on. Still the same suggestion, though. I'd look at what's needed to get your code compatible with it off.$slider = 'n00b';
-
Jun 2, 2003, 22:13 #5
Based on the disclaimer related to globals I am open to an alternative. I am a purist when it comes to doing things correctly.
Being a novice with PHP I do not see the harm storing values in a space not visible to the client. I have many constants loaded to the global array based on values in the db when the user logs in. I find this to be more manageable than looking up values in a text file.
As far as the forms go, PHP_SELF, I can keep these values from view using the globals vs. arguements visible in the http address.
Please post any links for tutorials and conversation threads along these thought lines.
Thanks for the interest and taking time to post the warning, zed
-
Jun 2, 2003, 22:22 #6
- Join Date
- Nov 2001
- Location
- Atlanta, GA, USA
- Posts
- 5,011
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by zed
Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?
-
Jun 2, 2003, 22:40 #7
This community is great!
I will embark on the new and secure way to use globals tomorrow.
Thanks again, zed
Bookmarks