Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   General Discussions (http://forums.winamp.com/forumdisplay.php?f=1)
-   -   PHP and user clients? (http://forums.winamp.com/showthread.php?t=200303)

PulseDriver 26th November 2004 19:33

PHP and user clients?
 
Do anyone in here know if PHP can read or identify the client which is trying to access the documents on my apache server?

ctn|chrisw 26th November 2004 19:45

$_SERVER['HTTP_USER_AGENT']

PulseDriver 26th November 2004 19:49

gee thanks... do you have any experience with this? Do you know where I can find a list of what the different browsers will return or do I have to download and install them all to test?

EDIT: I could prolly ask peeps into these forums to enter the site and take a screenshot of their view, at least some of them, so i guess I am pretty covered.

And the reason I need this, is to make sure I don't give any of the users the headache of having trouble using it. Only requirment I will have on my site is that the page will need a user agent with support of HTML 4.01 even though I write the whole site in XHTML 1.0 Transitional mainly for supporting CSS-incompatible browser.

fwgx 26th November 2004 21:03

create an empty text file called phpinfo.php and upload it to your server. set it to 775 and browse to it. there you go, loads of info.

PulseDriver 26th November 2004 21:33

Um I am no PHP guru nor FTP guru. Can you declear 775 for me? Is that some sort of file setting or somthing?

EDIT: NM... I figured. File configuration CHMOD to be exact.

But what should I expect in return from the file? A source code?

ryan 26th November 2004 22:22

I was bored so I looked up a bunch of user strings.

PHP Code:

<?php

$ua 
$_SERVER['HTTP_USER_AGENT'];

if(
strstr($ua"Firefox")) {
    echo 
"You're using the Mozilla Firefox browser";
}
else if(
strstr($ua"Galeon")) {
    echo 
"You're using Galeon browser";
}
else if(
strstr($ua"K-Melon")) {
    echo 
"You're using K-Melon";
}
else if(
strstr($ua"Konqueror")) {
    echo 
"You're using Konqueror";
}
else if(
strstr($ua"Lynx")) {
    echo 
"You're using Lynx";
}
else if(
strstr($ua"Netscape")) {
    echo 
"You're using Netscape";
}
else if(
strstr($ua"Opera")) {
    echo 
"You're using Opera";
}
else if(
strstr($ua"Safari")) {
    echo 
"You're using Safari";
}
else if(
strstr($ua"OmniWeb")) {
    echo 
"You're using OmniWeb";
}
else if(
strstr($ua"Mosaic")) {
    echo 
"It's 1993 all over again";
}
else if(
strstr($ua"iCab")) {
    echo 
"You're using the iCab browser";
}
else if(
strstr($ua"Dillo")) {
    echo 
"You're using the Dillo browser";
}
else if(
strstr($ua"Elinks")) {
    echo 
"You're using the Elinks text browser";
}
else if(
strstr($ua"WebTV")) {
    echo 
"You're using a WebTV browser";
}
else if(
strstr($ua"w3m")) {
    echo 
"You're using the w3m text browser";
}
else if(
strstr($ua"Mozilla")) {
    echo 
"You're using Mozilla, or a Mozilla based browser";
}
else if(
strstr($ua,"MSIE")) {
    echo 
"You're using MSIE, or an MSIE wrapper";
}

?>


PulseDriver 26th November 2004 22:24

lol :up: thanks :)

ryan 26th November 2004 22:33

Of course you could just do

PHP Code:

<?php

$ua 
$_SERVER['HTTP_USER_AGENT'];

echo 
"You're using $ua";

?>


PulseDriver 26th November 2004 22:35

My point is to know what browser is accessing the files, so I can return something which is compatible. I want to use CSS and make it possible for those with a CSS-incompatible browser to view as well. NN4 is the lowest I will go this time. Last time I did go all the way down to NN2.

Here take a look :)

http://www.aocore.com/test/index.php?language=english

ryan 26th November 2004 22:37

You'll have to check for version numbers in the user agents then.

yenerich 27th November 2004 01:03

Usually your server stats contains the info on how many visitors has each browser

PulseDriver 27th November 2004 01:30

yep, it does also, but I am not interested in what visitors I have. I wish to have a webpage that supports the users that is going to use this site. I am making it for someone and will not be located at my server eventually


All times are GMT. The time now is 11:00.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.