• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Environment Tests

L

Lighthater

Guest
#1
I know this may be a very broad question, but can anyone tell me how to create an environment test script? I might not even be calling it by the right name. Here is an example:

http://pci.chadwyck.com/envtest.cgi

A sample script would be ideal, but I will take anything I can get :D

Thanks in advance for any help.
 
L

Lighthater

Guest
#4
Yes, basically. I work in technical support and it is very helpful to know as much about the user as possible. We do an IP based authentication here, so knowing their IP is one thing I would want to capture. Also knowing information like OS, Browser, URL the user came from, etc would be very helpful. The example I posted is very close to what I want to have, but I just don't know who to do this.
 

SPeedY_B

I may actually be insane.
#5
\o/ <o/ \o_ \o|

Here you go then, i wrote this aaages ago and have found it useful ever since, it gathers user info via PHP and JavaScript...

PHP:
<!-- (c) SPeedY_B --><html><head>
<title>User Info  </title>

<style type="text/css">
BODY {
scrollbar-face-color: #ffffff;
scrollbar-shadow-color: #FFFFFF;
scrollbar-highlight-color: #FFFFFF;
scrollbar-3dlight-color: #4A9FE0;
scrollbar-darkshadow-color: #ffffff;
scrollbar-track-color: #ffffff;
scrollbar-arrow-color: #4A9FE0;
}
</style>
</head><BODY onLoad="window.status='SPeedY_B ²ºº² '; return true;">
<body bgcolor="#FFFFFF" link="#3366FF" vlink="#3366FF" alink="#3366FF">
<font Face="Tahoma" color="#4A9FE0" size="2">
<i>SPeedY_B ²ºº²</i>
<hr color="#4A9FE0">
<div align="center"><font Face="Tahoma" color="#4A9FE0" size="2"><U>User Info</u></div>
<table align=center border=0>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">PHP Info:</td>
 <td></td>
</tr>
<? $ipaddr = getenv("REMOTE_ADDR"); ?>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">IP Adress:</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><?echo $ipaddr; ?></td>
</tr><font Face="Tahoma" color="#4A9FE0" size="2">

<?
$what = gethostbyaddr($ipaddr);

?>

<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Host:</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><?echo $what; ?></td>

<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Refering Page:</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><?echo getenv("HTTP_REFERER"); ?></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Retreival Method:</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><?echo getenv("REQUEST_METHOD"); ?></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Browser Accept:</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><?echo getenv("HTTP_ACCEPT"); ?></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Server Protocol:</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><?echo getenv("SERVER_PROTOCOL"); ?></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Browser Version:</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><?echo getenv("HTTP_USER_AGENT"); ?></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Language:</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><?echo getenv("HTTP_ACCEPT_LANGUAGE"); ?></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Port:</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><?echo getenv("REMOTE_PORT"); ?></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Java Info:</td>
 <td></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Browser:</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><Script>document.write(navigator.appName)</script></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Operating System:</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><Script>document.write(navigator.platform)</script></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Resolution:</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><Script>document.write(screen.width + " x " + screen.height)</script></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Colour Depth:</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><Script>document.write(screen.colorDepth + " bit")</script></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Java Enabled?</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><script language="JavaScript">
        if(navigator.javaEnabled()){document.write("Yup")}
        else{document.write("Nope")}
     </script></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Anti-aliasing ?</td>
 <td><font Face="Tahoma" color="#4A9FE0" size="2"><script language="JavaScript">
        if(window.screen.fontSmoothingEnabled == true){document.write("Yup")}
        else{document.write("Nope")}
     </script></td>
</tr>
<tr>
 <td><font Face="Tahoma" color="#4A9FE0" size="2">Plugins (Netscape):</td>
 <td></td>
</tr>
<font Face="Tahoma" color="#4A9FE0" size="2">
<script language="JavaScript">
 for(i=0; i<navigator.plugins.length; i++){
   document.writeln("<tr>");
   document.writeln("<td colspan=2>" + navigator.plugins[i].name + "</td>");
   document.writeln("</tr>");
 }
</script>
</table>
</BODY></HTML>
Hope its of some help .....
 

SPeedY_B

I may actually be insane.
#6
Here's an example of what it outputs when i use it via mozilla (yes, the user agnet is fake :) )

User Info
PHP Info:
IP Adress: 127.0.0.1
Host: localhost
Refering Page:
Retreival Method: GET
Browser Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
Server Protocol: HTTP/1.1
Browser Version: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Language: en-us, en;q=0.50
Port: 2355
Java Info:
Browser: Netscape
Operating System: Win32
Resolution: 1600 x 1200
Colour Depth: 32 bit
Java Enabled? Nope
Anti-aliasing ? Nope
Plugins (Netscape):
Mozilla Default Plug-in
Shockwave Flash
Adobe Acrobat
QuickTime Plug-in 6.0.2
QuickTime Plug-in 6.0.2
QuickTime Plug-in 6.0.2
QuickTime Plug-in 6.0.2
QuickTime Plug-in 6.0.2
QuickTime Plug-in 6.0.2
Microsoft (R) DRM
Windows Media Player Plug-in Dynamic Link Library
Microsoft® Windows Media Services
 

SPeedY_B

I may actually be insane.
#8
heh, its something i had pre-prepared so to speak :D
It was one of the first things i wanted to do when i first started using PHP over html, not that i've ever found any real implementation for it (other than blocking peons access to things :p ) but its always a handy file to have lurking about :D
 
L

Lighthater

Guest
#9
Speedy, Thanks again for this. It was just what I was looking for! Just a few more tweaks/additions and I will be all set! You are King for a day (or longer if you like)!
 

Members online

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,013
Latest member
Pdawgintown