473,503 Members | 1,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extracting Information

Does anyone know where I should start with this. Im trying to extract the
information in:
$_SERVER['HTTP_USER_AGENT'

But I dont know how to get the information out? What functions should I be
looking at. I want to get the OS, Browser, IP etc..

Thanks
Hayden Kirk
Jul 17 '05 #1
10 1963
Maybe try

print_r($_SERVER);

Jay

Hayden Kirk wrote:
Does anyone know where I should start with this. Im trying to extract the
information in:
$_SERVER['HTTP_USER_AGENT'

But I dont know how to get the information out? What functions should I be
looking at. I want to get the OS, Browser, IP etc..

Thanks
Hayden Kirk


Jul 17 '05 #2
I mean like splitting it up into sections, like an $OS string, $user_agent
string, $version string etc... Using it to store in a database to monitor
which versions of browsers and OS's come to our site,
Thanks
Hayden Kirk

"Jay Moore" <ad*****@isp.tld> wrote in message
news:7j******************@twister.rdc-kc.rr.com...
Maybe try

print_r($_SERVER);

Jay

Hayden Kirk wrote:
Does anyone know where I should start with this. Im trying to extract the information in:
$_SERVER['HTTP_USER_AGENT'

But I dont know how to get the information out? What functions should I be looking at. I want to get the OS, Browser, IP etc..

Thanks
Hayden Kirk

Jul 17 '05 #3
Use the get_browser() function.

See http://www.php.net/manual/en/function.get-browser.php.

Uzytkownik "Hayden Kirk" <sp**@spam.com> napisal w wiadomosci
news:Jh*******************@news02.tsnz.net...
Does anyone know where I should start with this. Im trying to extract the
information in:
$_SERVER['HTTP_USER_AGENT'

But I dont know how to get the information out? What functions should I be
looking at. I want to get the OS, Browser, IP etc..

Thanks
Hayden Kirk

Jul 17 '05 #4
Without using that function :P

Thanks,
Hayden Kirk

"Chung Leong" <ch***********@hotmail.com> wrote in message
news:K4********************@comcast.com...
Use the get_browser() function.

See http://www.php.net/manual/en/function.get-browser.php.

Uzytkownik "Hayden Kirk" <sp**@spam.com> napisal w wiadomosci
news:Jh*******************@news02.tsnz.net...
Does anyone know where I should start with this. Im trying to extract the information in:
$_SERVER['HTTP_USER_AGENT'

But I dont know how to get the information out? What functions should I be looking at. I want to get the OS, Browser, IP etc..

Thanks
Hayden Kirk


Jul 17 '05 #5
Yeah, good luck with that since all browsers output their information
differently. :(

-Jay

Hayden Kirk wrote:
I mean like splitting it up into sections, like an $OS string, $user_agent
string, $version string etc... Using it to store in a database to monitor
which versions of browsers and OS's come to our site,
Thanks
Hayden Kirk

"Jay Moore" <ad*****@isp.tld> wrote in message
news:7j******************@twister.rdc-kc.rr.com...
Maybe try

print_r($_SERVER);

Jay

Hayden Kirk wrote:
Does anyone know where I should start with this. Im trying to extract
the
information in:
$_SERVER['HTTP_USER_AGENT'

But I dont know how to get the information out? What functions should I
be
looking at. I want to get the OS, Browser, IP etc..

Thanks
Hayden Kirk



Jul 17 '05 #6
Hayden Kirk wrote:
Without using that function :P


find a list UA strings of all the browsers you anticipate will access
your website. Assume or ensure that anything that makes http requests
from your site will will not spoof this HTTP UA header. Then buy a big
bag of coffe, take a few weeks off work, and get a copy of "Mastering
Regular Expressions" from oreileys.

Jul 17 '05 #7
[Top-post fixed. Please don't top-post]

"Hayden Kirk" <sp**@spam.com> wrote in message news:<aD*******************@news02.tsnz.net>...
"Chung Leong" <ch***********@hotmail.com> wrote in message
news:K4********************@comcast.com...
Use the get_browser() function.

See http://www.php.net/manual/en/function.get-browser.php.

Without using that function :P

Read the user notes carefully. It has the link to
<http://phpsniff.sourceforge.net/>
--
http://www.sendmetoindia.com - Send Me to India!
Email: rrjanbiah-at-Y!com
Jul 17 '05 #8
Well, there isn't a way. The user agent string is a complete mess. You can't
get what you want by parsing it.

Uzytkownik "Hayden Kirk" <sp**@spam.com> napisal w wiadomosci
news:aD*******************@news02.tsnz.net...
Without using that function :P

Thanks,
Hayden Kirk

"Chung Leong" <ch***********@hotmail.com> wrote in message
news:K4********************@comcast.com...
Use the get_browser() function.

See http://www.php.net/manual/en/function.get-browser.php.

Uzytkownik "Hayden Kirk" <sp**@spam.com> napisal w wiadomosci
news:Jh*******************@news02.tsnz.net...
Does anyone know where I should start with this. Im trying to extract the information in:
$_SERVER['HTTP_USER_AGENT'

But I dont know how to get the information out? What functions should
I
be looking at. I want to get the OS, Browser, IP etc..

Thanks
Hayden Kirk



Jul 17 '05 #9
What about something with regular expressions?

There must be a way if there is that sniff php script...

"Chung Leong" <ch***********@hotmail.com> wrote in message
news:bv********************@comcast.com...
Well, there isn't a way. The user agent string is a complete mess. You can't get what you want by parsing it.

Uzytkownik "Hayden Kirk" <sp**@spam.com> napisal w wiadomosci
news:aD*******************@news02.tsnz.net...
Without using that function :P

Thanks,
Hayden Kirk

"Chung Leong" <ch***********@hotmail.com> wrote in message
news:K4********************@comcast.com...
Use the get_browser() function.

See http://www.php.net/manual/en/function.get-browser.php.

Uzytkownik "Hayden Kirk" <sp**@spam.com> napisal w wiadomosci
news:Jh*******************@news02.tsnz.net...
> Does anyone know where I should start with this. Im trying to
extract the
> information in:
> $_SERVER['HTTP_USER_AGENT'
>
> But I dont know how to get the information out? What functions
should I
be
> looking at. I want to get the OS, Browser, IP etc..
>
> Thanks
> Hayden Kirk
>
>



Jul 17 '05 #10
Nope, 'cause there isn't a well defined way to format the text string. And
the browsers all pretend to be each other. IE tells you it's Mozilla, Opera
tells you it's IE, etc. And on top of that, the OS name is screwed. Win2K is
listed as NT 5.0 while XP is NT 5.1.

The only reliable way to detect the browser type is to compare the signature
to a database of known browsers, which is what get_browser() does.

Given that few of us has the resource to support every browser under the
sun, it's probably more practical to check for specific browser. If see if
the client is IE, do strstr($_SERVER['HTTP_AGENT'], "MSIE"). To see if it's
Netscape 6 or above or something like it, look for "Gecko".

Uzytkownik "Hayden Kirk" <sp**@spam.com> napisal w wiadomosci
news:p3*******************@news02.tsnz.net...
What about something with regular expressions?

There must be a way if there is that sniff php script...

"Chung Leong" <ch***********@hotmail.com> wrote in message
news:bv********************@comcast.com...
Well, there isn't a way. The user agent string is a complete mess. You

can't
get what you want by parsing it.

Uzytkownik "Hayden Kirk" <sp**@spam.com> napisal w wiadomosci
news:aD*******************@news02.tsnz.net...
Without using that function :P

Thanks,
Hayden Kirk

"Chung Leong" <ch***********@hotmail.com> wrote in message
news:K4********************@comcast.com...
> Use the get_browser() function.
>
> See http://www.php.net/manual/en/function.get-browser.php.
>
> Uzytkownik "Hayden Kirk" <sp**@spam.com> napisal w wiadomosci
> news:Jh*******************@news02.tsnz.net...
> > Does anyone know where I should start with this. Im trying to extract the
> > information in:
> > $_SERVER['HTTP_USER_AGENT'
> >
> > But I dont know how to get the information out? What functions

should
I
be
> > looking at. I want to get the OS, Browser, IP etc..
> >
> > Thanks
> > Hayden Kirk
> >
> >
>
>



Jul 17 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2930
by: Gnaneshwar Babu | last post by:
Hi I am facing a problem with extracting event logs of win32 to a file. Am using the following code to extract eventlogs to file use Win32::EventLog; $handle=Win32::EventLog->new("System",...
2
1336
by: Shawn | last post by:
I have an XML file that contains nodes and I'm having no problem extracting the information using ASP. However I can't seem to get the ID number from the deliverrequest node from the example below....
5
2171
by: Astra | last post by:
Hi All Is there an ASP way of extracting the height and width of a swf file so that I can specify these dims when adding the whole OBJECT code to the web page? Thanks Robbie
1
17125
by: v0lcan0 | last post by:
Any help on extracting the time part from the datetime field in SQL database. even though i had entered only the time part in the database when i extract the field it gives me only the date...
2
2623
by: Chris Belcher | last post by:
First some background... The database tracks Action Items assigned to a group of 20 or so managers. Once the assignment is created it is then emailed to each of the managers that are included in...
0
1232
by: k_nil | last post by:
Hi, I have created a self extracting exe. the exe will extract an exe and a txt file on the machine. I wana launch the exe as soon as the extraction happens. how could i do this? any information...
1
1445
by: Mark Jones | last post by:
Can anyone point me towards information/.net components that can be used for text extraction and pattern recognition? In particular, I am interested in working with a screenshot and extracting...
5
1978
by: klall | last post by:
Hello. I need to extract date information from a memo field entered in the following way: 01/01/2005 - 31/12/2005 01/01/2004 - 31/12/2004 01/01/2003 - 31/12/2003 01/01/1996 - 31/12/1996. The...
1
1203
by: TWX | last post by:
Hi there. I need to create a PHP programme that will return a person's birthday when his class and index number is keyed. I have the neccesary information but I only know how to create the frame of...
6
4427
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7074
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6982
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5572
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1501
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.