1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
|
<script type="text/javascript">
/*
Script Name: Your Computer Information
Author: Harald Hope, Website: http://TechPatterns.com/
Script Source URI: http://TechPatterns.com/downloads/browser_detection.php
Version 1.0.4
Copyright (C) 20 October 2004
This script is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This script is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
Lesser GPL license text:
http://www.gnu.org/licenses/lgpl.txt
This script requires the Full Featured Browser Detection and the Javascript Cookies scripts
to function.
You can download them here.
http://TechPatterns.com/downloads/browser_detection_php_ar.txt
http://TechPatterns.com/downloads/javascript_cookies.txt
*/
/*
If your page is XHMTL 1 strict, you have to
put this code into a js library file or your
page will not validate
*/
function client_data(info)
{
if (info == 'width')
{
width_height_html = '<h4 class="right-bar">Current Screen Resolution</h4>';
width = (screen.width) ? screen.width:'';
height = (screen.height) ? screen.height:'';
width_height_html += '<p class="right-bar">' + width + " x " +
height + " pixels</p>";
(width && height) ? document.write(width_height_html):'';
}
else if (info == 'js' )
{
document.write('<p class="right-bar">JavaScript is enabled.</p>');
}
else if ( info == 'cookies' )
{
expires ='';
Set_Cookie( 'cookie_test', 'it_worked' , expires, '', '', '' );
string = '<h4 class="right-bar">Cookies</h4><p class="right-bar">';
if ( Get_Cookie( 'cookie_test' ) )
{
string += 'Cookies are enabled</p>';
}
else {
string += 'Cookies are disabled</p>';
}
document.write( string );
}
}
</script>
<div class="float-left-01">
<h3 class="h-right-bar">Your Computer</h3>
<?php
$os = '<h4 class="right-bar">Operating System:</h4><p class="right-bar">';
$full = '';
// change these two to match your include path/and file name you give the script
include('browser_detection.php');
$browser_info = browser_detection('full');
$browser_info[] = browser_detection('moz_version');
switch ($browser_info[5])
{
case 'win':
$os .= 'Windows ';
break;
case 'nt':
$os .= 'Windows<br />NT ';
break;
case 'lin':
$os .= 'Linux<br /> ';
break;
case 'mac':
$os .= 'Mac ';
break;
case 'unix':
$os .= 'Unix<br />Version: ';
break;
default:
$os .= $browser_info[5];
}
if ( $browser_info[5] == 'nt' )
{
if ($browser_info[6] == 5)
{
$os .= '5.0 (Windows 2000)';
}
elseif ($browser_info[6] == 5.1)
{
$os .= '5.1 (Windows XP)';
}
}
elseif ( ( $browser_info[5] == 'mac' ) && ( $browser_info[6] >= 10 ) )
{
$os .= 'OS X';
}
elseif ( $browser_info[5] == 'lin' )
{
$os .= ( $browser_info[6] != '' ) ? 'Distro: ' . ucfirst ($browser_info[6] ) : 'Smart Move!!!';
}
elseif ( $browser_info[6] == '' )
{
$os .= ' (version unknown)';
}
else
{
$os .= strtoupper( $browser_info[6] );
}
$full .= $os . '</p><h4 class="right-bar">Current Browser:</h4><p class="right-bar">';
if ($browser_info[0] == 'moz' )
{
$a_temp = $browser_info[count( $browser_info ) - 1];// the moz array is last item
$full .= ($a_temp[0] != 'mozilla') ? 'Mozilla/ ' . ucfirst($a_temp[0]) . ' ' : ucfirst($a_temp[0]) . ' ';
$full .= $a_temp[1] . '<br />';
$full .= 'ProductSub: ';
$full .= ( $a_temp[4] != '' ) ? $a_temp[4] . '<br />' : 'Not Available<br />';
$full .= ($a_temp[0] != 'galeon')?'RV version: ' . $a_temp[3] : '';
}
elseif ( $browser_info[0] == 'ns' )
{
$full .= 'Netscape ';
$full .= $browser_info[1] . '<br />';
}
else
{
$full .= ($browser_info[0] == 'ie') ? strtoupper($browser_info[7]) : ucwords($browser_info[7]);
$full .= ' ' . $browser_info[1];
}
echo $full . '</p>';
?>
<script type="text/javascript">
client_data('width');
</script>
<h4 class="right-bar">JavaScript</h4>
<script type="text/javascript">
client_data('js');
</script>
<noscript>
<p class="right-bar">JavaScript is disabled</p>
</noscript>
<script type="text/javascript">
client_data('cookies');
</script>
</div> |