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 <[EMAIL PROTECTED]> 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

Reply via email to