Solved

User Information (Browser, System, Colors Etc)

Posted on 2006-07-01
7
238 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now