?
Solved

User Information (Browser, System, Colors Etc)

Posted on 2006-07-01
7
Medium Priority
?
243 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
Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

 

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 1000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

765 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