note 33343 added to tutorial.useful

From: Date: Mon, 23 Jun 2003 15:41:43 +0000
Subject: note 33343 added to tutorial.useful
Groups: php.notes 
Request: Send a blank email to php-notes+get-50876@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/tutorial.useful.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33343 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33343&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33343&report=yes

« previous php.notes (#50876) next »