Solved

User Information (Browser, System, Colors Etc)

Posted on 2006-07-01
7
237 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
Comment Utility
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
Comment Utility
<?php
echo phpinfo();// Get infomation
>

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

Expert Comment

by:dimakh
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:SR301
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

771 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

8 Experts available now in Live!

Get 1:1 Help Now