Jump to content

User Agent Header Help

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
beastilio

beastilio

    Newbie

  • Members
  • PipPip
  • 10 posts
Hello again CodeCall!

I am wondering, how would I check the user agent for a website? I want to send anyone with:


Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko)
Version/3.0 Mobile/1A543a Safari/419.3


to another page on my site if they visit the index file.

Thanks, Beastilio

#2
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
In PHP this is the user agent:
$_SERVER['HTTP_USER_AGENT']

You could also use this function: get_browser()

#3
beastilio

beastilio

    Newbie

  • Members
  • PipPip
  • 10 posts

Sidewinder said:

In PHP this is the user agent:
$_SERVER['HTTP_USER_AGENT']

You could also use this function: get_browser()


Working great! Thanks!

#4
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
You can even use Javascript (but I would not advise it as it is client side)

Look at this (gives you much more than what you want):
Get User Info, JavaScript Tutorial, Howto, Gather Visitor Information, Details, Web-Wise-Wizard

#5
Walls

Walls

    Newbie

  • Members
  • Pip
  • 8 posts
If you use SSI (server side include) where you have .shtml extension then you can use:
<!--#echo var="HTTP_USER_AGENT"-->

Mobile Walls | Accordian Partitions | Operable Walls | Mobile Glass Walls