Welcome to Dream.In.Code
Click Here
Getting PHP Help is Easy!

Join 117,540 PHP Programmers for FREE! Ask your question and get quick answers from experts. There are 1,721 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Something is wrong trying to access standard CGI variables

 
Reply to this topicStart new topic

Something is wrong trying to access standard CGI variables

geethalakshmi
post 16 Jul, 2008 - 06:07 AM
Post #1


New D.I.C Head

*
Joined: 9 Apr, 2008
Posts: 13

I'm trying to access one of the standard CGI variables (such as $DOCUMENT_ROOT or $HTTP_REFERER) in a user-defined function, and it can't seem to find it. What's wrong?

Regards,
geetha
Web Master Resources
User is offlineProfile CardPM

Go to the top of the page


AdaHacker
post 16 Jul, 2008 - 06:58 AM
Post #2


D.I.C Head

**
Joined: 17 Jun, 2008
Posts: 112



Thanked 15 times
My Contributions


You want to use the $_SERVER suberglobal for those, e.g. $_SERVER['DOCUMENT_ROOT'] and $_SERVER['HTTP_REFERER']. Using just $DOCUMENT_ROOT and $HTTP_REFERER only works if you have register_globals turned on in your php.ini. It's turned off by default and has been since PHP 4.2, as it has the potential to cause security problems.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/7/08 05:12PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month