Solved

User Information (Browser, System, Colors Etc)

Posted on 2006-07-01
7
242 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
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…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

729 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