Error with HTTP_USER_AGENT?!?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Azmerod
Forum Newbie
Posts: 5
Joined: Mon Oct 14, 2002 5:41 pm
Contact:

Error with HTTP_USER_AGENT?!?

Post by Azmerod »

I just installed php 4.3.2 on my windows system with mySQL and Apache but now I keep getting this error in one of my files.

Notice: Undefined variable: HTTP_USER_AGENT in mainfile.php on line 16

I don't know why it would be undefined, if anyone could help it would be appreciated.
Azmerod
Forum Newbie
Posts: 5
Joined: Mon Oct 14, 2002 5:41 pm
Contact:

Post by Azmerod »

ok, well i figured that out for myself
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Always nice to give the answer for others who may come after you. I am assuming you found $_SERVER['HTTP_USER_AGENT'].

Mac
WetChicken
Forum Newbie
Posts: 3
Joined: Fri Jul 09, 2004 2:51 pm
Location: Concord, NH

Post by WetChicken »

Azmerod, what was your solution? I am having the same issue.

Thanks

Chicken
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

You're getting the same error?

Try using $_SERVER['HTTP_USER_AGENT'].
WetChicken
Forum Newbie
Posts: 3
Joined: Fri Jul 09, 2004 2:51 pm
Location: Concord, NH

Post by WetChicken »

This is a fresh install of Apache 1.3.31, PHP 4.3.7, MySQL 3.23.58, PHP-Nuke 7.1, and PHPMyAdmin 2.2.7 on Win2K Pro.
PHP works fine with hello, world and I can surf to pages, I can administer MySQL, everything appears to be working correctly.
The error is with PHP-Nuke, and I am figuring it is a simple setting somehwere. Unfortunately I am not familiar enough being new to this and all I found on google was this forum.
I appreciate the offer on your change, but I figure Nuke has it that way for a reason.

Berrick ain't thaht fahh from heah, you know. Do you listen to the morning buzz?


Thanks

Chicken.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

No, they don't.

They most likely developed their 7.1 script with register_globals on. That's why I prefer to code my own..
WetChicken
Forum Newbie
Posts: 3
Joined: Fri Jul 09, 2004 2:51 pm
Location: Concord, NH

Post by WetChicken »

I actually had the password and database name wrong. I tried this script test.php:

Code: Select all

<?php 
include("config.php"); 
mysql_connect("$dbhost", "$dbuname", "$dbpass"); 
mysql_select_db("$dbname"); 
echo mysql_error(); 
phpinfo(); 
?>
and if you get anything more than the PHP info, it is bad.

The code was from karakas-online.de/forum/viewtopic.php?p=72.

Jason
Post Reply