note 33345 deleted from tutorial.useful by alindeman
| From: | alindeman@php.net | Date: | Mon, 23 Jun 2003 16:31:07 +0000 |
| Subject: | note 33345 deleted from tutorial.useful by alindeman | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-50883@lists.php.net to get a copy of this message | ||
Note Submitter: Yonas Tesfazghi Weldeselassie (ICTP)
----
I think it makes sense to warn beginners of Php (like me) to take extra care about deprecated
variables. I was wondering why the command
echo $_SERVER["HTTP_USER_AGENT"];
was giving me no output at all until I finally discovered that the autoglobal variable $_SERVER was
returning an empty string (I discovered it was empty by looking at its length via strlen function).
I finally saw the note supplied by Jakesyuk that informs to read PHP Autoglobals Note which I did
and found out that I had to use the deprecatted syntax
echo $HTTP_SERVER_VARS["HTTP_USER_AGENT"];
which worked fine. So begginers be informed to try the later before you panic and start to get
lost!!! Good luck.