Re: PHP code will not work

From: Date: Thu, 10 Jul 2008 06:15:47 +0000
Subject: Re: PHP code will not work
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-276559@lists.php.net to get a copy of this message
PHP at the command line doesn't run within a web server environment. ~Ted On 9-Jul-08, at 11:07 PM, Sanjay Mantoor wrote:
Hi, I found $_SERVER['HTTP_USER_AGENT'] works when you are using with browser by server like Apache. If you are executing your code like script in command prompt it may not work. I got below :- PHP Notice: Undefined index: HTTP_USER_AGENT If you use print_r($_SERVER) , you can see all the listing of indexes. On Wed, Jul 9, 2008 at 7:15 PM, Mike V <mikenospam0@gmail.com> wrote:
I had this problem and just figured it out. I was copying and pasting the code snippet from the tutorials page to my test editor and in the process picked up an invisible ctrl char. Doh!! Joseph Subida wrote:
The error I get when I try <?php echo $_SERVER['HTTP_USER_AGENT']; ?> is Parse error: syntax error, unexpected T_VARIABLE in /Library/WebServer/Documents/test.php on line 106 I tried Googling "T_VARIABLE" and haven't found any useful solutions. Any ideas? Thanks! -J.C. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- View this message in context: http://www.nabble.com/PHP-code-will-not-work-tp17811807p18362005.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--Thanks, Sanjay Mantoor --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#276559) next »