Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hopefully a dumb question

Status
Not open for further replies.

Ladyhawk

Programmer
Jan 22, 2002
534
AU
This is my php file:

<html><head><title>PHP Test</title></head>
<body>
<?php echo $HTTP_USER_AGENT; ?>
</body></html>

When I run this, I get:

Notice: Undefined variable: HTTP_USER_AGENT in C:\Inetpub\ Web Site\test.php on line 5

Any ideas, anyone?

Ladyhawk. [idea]
** ASP/VB/Java Programmer **
 
What version of PHP do you have?
***************************************
Party on, dudes!
[cannon]
 
Yeah, they probably have an old version of PHP installed (or if it is your offline host, you have an older version of PHP installed).
 
I have 4.2 installed. Ladyhawk. [idea]
** ASP/VB/Java Programmer **
 
4.0.6 here and it works just fine. ***************************************
Party on, dudes!
[cannon]
 
try $_SERVER[HTTP_USER_AGENT]

This will work in your version. Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top