user agent not available on local server?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

user agent not available on local server?

Postby morris_buttermaker » 23. August 2010 15:05

Howdy, I have a simple if/else line of php detecting user agent, if it's Firefox on OSX, do this, else do that...

It works fine live but not on my local install of xampp.

I tried this too as a check and live it feeds me back the agent, local nothing.

echo "search for firefox: ==" . stristr($_SERVER['HTTP_USER_AGENT'],"Firefox") . "==";

FYI, my file directory is not in the install location, could that have an affect on it?

Thanks
morris_buttermaker
 
Posts: 4
Joined: 23. August 2010 12:34

Re: user agent not available on local server?

Postby JonB » 23. August 2010 16:04

my file directory


what do you mean by that? Are you referring to the DocumentRoot?

have you examined the Apache access.log?

:shock:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: user agent not available on local server?

Postby morris_buttermaker » 23. August 2010 16:28

Yes, my documentroot was C:\Xampp\htdocs
I switched to D:\Websites

The sites work and php is running, I can do a basic hello world and whatnot, it's just that useragent not showing up locally.

Not at home so I can't check any logs.
morris_buttermaker
 
Posts: 4
Joined: 23. August 2010 12:34

Re: user agent not available on local server?

Postby JonB » 23. August 2010 17:44

Well check those logs -

See if the visits from your machine to localhost are being logged.

IF the access log is correctly reporting the user-agent, then there's proabably a logic flaw somewhere.

It might be a good idea

If there's nothing in the access.log - that's another matter.

Good Luck
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: user agent not available on local server?

Postby morris_buttermaker » 23. August 2010 17:55

Asked a guy at work here too and he said check to see if php shorthand is on, I thought I had it on, but maybe not.
morris_buttermaker
 
Posts: 4
Joined: 23. August 2010 12:34

Re: user agent not available on local server?

Postby glitzi85 » 23. August 2010 20:07

Better than switching that stupid short_open_tags to on is using the correct format:
Code: Select all
<?php
Code
?>


glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 186 guests