PHP - User Browser Detection...

Status
Not open for further replies.

cheetah

In the zone
Hello Guys,
I want a php script so show a link on the web page depending on user's browser. Is there somebody to make such a script....

I want to show a different link for Opera, Firefox ,Internet explorer and undetected browsers...Please post the php script if u know...

Full Code Plz...i dont know much php.. :?



Thanx.
 

kalpik

In Pursuit of "Happyness"
Code:
<?php
	echo "Your current browser is: ";
	echo $_SERVER['HTTP_USER_AGENT'];
?>

This is how u detect the browser. I guess this will help u to redirect.
 
OP
C

cheetah

In the zone
Thanx but
i want to show a link relative to the browser the visitor is using....

like if he is using Internet Explorer...

I will show him : *www.mysite.com/forinternetexplorerusers.htm

Fore Firefox:-
*www.mysite.com/forfirefoxusers.htm

Please help...
 

alib_i

Cyborg Agent
cant you do this much .. just put an if-else condition there

this will help ::
Code:
$br=$_SERVER['HTTP_USER_AGENT']; 

if (eregi("firefox", $br)) 		echo "*www.mysite.com/forfirefoxusers.htm";
elseif(eregi("opera", $br))		echo "*www.mysite.com/foroperausers.htm";
else							        echo "*www.mysite.com/forinternetexplorerusers.htm";

-----
alibi
 

tuxfan

Technomancer
Do you know Javascript? This can be achieved even by Javascript.

If not, then wait for 2-3 days. I am learning PHP and was on the look for a small project. I will take up this one ;)
 

tuxfan

Technomancer
Glad to know you've got it working. I know its pretty simple :) but post the code anyway ;)

I am as of now reading an e-book ;) PHP 4 in 24 hours. Next stop is MySQL in 21 days :D
 
OP
C

cheetah

In the zone
The one
Code:
$br=$_SERVER['HTTP_USER_AGENT'];

if (eregi("firefox", $br))       echo "*www.mysite.com/forfirefoxusers.htm";
elseif(eregi("opera", $br))      echo "*www.mysite.com/foroperausers.htm";
else
worked just fine for me.... :wink:
 
OP
C

cheetah

In the zone
Hello Guys, I have picked some PHP and made a MailBomber script using the PHP Mail Function.

I named it Hee-Haw Mailer (A.K.A Horselaugh Mailer

Get it from my site ... *www.kkavyanjali.com/heehaw

Made it just for educational purposes...
 
Status
Not open for further replies.
Top Bottom