Page 1 of 1
Error with HTTP_USER_AGENT?!?
Posted: Tue Jun 03, 2003 12:41 am
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.
Posted: Tue Jun 03, 2003 12:59 am
by Azmerod
ok, well i figured that out for myself
Posted: Tue Jun 03, 2003 3:24 am
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
Posted: Fri Jul 09, 2004 2:51 pm
by WetChicken
Azmerod, what was your solution? I am having the same issue.
Thanks
Chicken
Posted: Fri Jul 09, 2004 3:14 pm
by d3ad1ysp0rk
You're getting the same error?
Try using $_SERVER['HTTP_USER_AGENT'].
Posted: Fri Jul 09, 2004 3:29 pm
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.
Posted: Fri Jul 09, 2004 3:40 pm
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..
Posted: Fri Jul 09, 2004 4:00 pm
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