Solved

User Information (Browser, System, Colors Etc)

Posted on 2006-07-01
7
239 Views
Last Modified: 2013-11-18
Hi Guys,

I have a log in page for clients to access a website. Each username, has with it a static IP in the database. When they log in, I want to check this, and record any changes...

Having said that, I want to record not only the users IP (and proxy if they use one), but other information so I can adjust how the site performs.

I'd like to capture the users operating system, browser, screen size, colors, plug ins, Javascript, cookies and as I said, IP. I have not found any PHP based code, which can do all of this. If someone could arrange this, that would be great. I'm not looking for the MySQL side of things, just the variables so I can pass them over... :)

Regards,

SR
0
Comment
Question by:SR301
7 Comments
 
LVL 49

Expert Comment

by:Roonaan
ID: 17023652
All stuff available is in the $_SERVER array. Screen resolution, colors, plugins and javascript can only be detected from javascript. You would have to build yourself an inbetween page to capture this details before forwarding your client to the original destination page.

-r-
0
 
LVL 10

Expert Comment

by:Khanh Doan
ID: 17023702
<?php
echo phpinfo();// Get infomation
>

Then use $_SERVER array to display it.
Goodluck.
Bonmat86.
0
 
LVL 1

Expert Comment

by:dimakh
ID: 17023759
Hi,

PHP has in-build server variables to capture all these details you mentioned above.
here are few examples:
$browser = $_SERVER['HTTP_USER_AGENT'];
$ip = $_SERVER['REMOTE_ADDR'];
$time = date ("G");
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

i hope it solves your pbm. let me know if you need any more info on this.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:SR301
ID: 17025307
Dimakh - This is more what I'm looking for, however I do need something a little more complete. While I'm aware HTTP_USER_AGENT gives me most of what I need, I'd like to break it up into seperate fields for browser, and operating system. Also, how can I capture the users screen size and colors ?
0
 
LVL 10

Accepted Solution

by:
Khanh Doan earned 250 total points
ID: 17025341
User Details :

<BODY>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var xy = navigator.appVersion;
xz = xy.substring(0,4);
document.write("<center><table border=1 cellpadding=2><tr><td>");
document.write("<center><b>", navigator.appName,"</b>");
document.write("</td></tr><tr><td>");
document.write("<center><table border=1 cellpadding=2><tr>");
document.write("<td>Code Name: </td><td><center>");
document.write("<b>", navigator.appCodeName,"</td></tr>");
document.write("<tr><td>Version: </td><td><center>");
document.write("<b>",xz,"</td></tr>");
document.write("<tr><td>Platform: </td><td><center>");
document.write("<b>", navigator.platform,"</td></tr>");
document.write("<tr><td>Pages Viewed: </td><td><center>");
document.write("<b>", history.length," </td></tr>");
document.write("<tr><td>Java enabled: </td><td><center><b>");
if (navigator.javaEnabled()) document.write("sure is!</td></tr>");
else document.write("not today</td></tr>")
document.write("<tr><td>Screen Resolution: </td><td><center>");
document.write("<b>",screen.width," x ",screen.height,"</td></tr>");
document.write("</table></tr></td></table></center>");
// End -->
</script>

<!-- Script Size:  1.34 KB  -->

It will output :

Microsoft Internet Explorer
Code Name:  Mozilla
Version:  4.0
Platform:  Win32
Pages Viewed:  12
Java enabled:  sure is!
Screen Resolution:  1024 x 768

From my Javascripts collection.
Bonmat86.
0
 

Author Comment

by:SR301
ID: 17026462
Bonmat86 - This is almost exactly what I need ! While I understand PHP can't do everything I'm asking, what you have provided has been a huge help... I have written something which will give me the users OS in PHP, and am now looking for something to take care of the browser side of things... If you have anything PHP based, this is really what I'm after...

None the less, I will increase the point before I accept any answer, and split them with you !

Still hope to find something more complete... :)
0
 

Author Comment

by:SR301
ID: 17026493
Never Mind - I have it all worked out now anyway...
Bonmat86 - While this is not a total answer, at least you did try.... MANY Thanks !
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question