There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen boot bsod computer connection crash css dell display driver drivers email error ethernet excel explorer firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook express partition password printer problem router slow software sound trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Some Coding Help [HTML,JAVASCRIPT]


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
The Infinity's Avatar
Senior Member with 575 posts.
 
Join Date: May 2005
Location: Florida
Experience: Advanced
09-Mar-2007, 12:52 AM #1
Question Some Coding Help [HTML,JAVASCRIPT]
I was hoping someone could help me out with creating a code that I would like to have on my website.

I am looking to have a box on the right side of my site that shows the following things about the person as they are viewing the site in their browser.

Their Browser: (Firefox 2.0, IE7... etc.)
Their IP:
Their OS: (Windows XP)
Their ISP Host: (Bellsouth, Comcast)

I already have something setup for their Resolution and if Java is enabled or not. But I wanted to add the following just so when people logged on they had this other information to see. So Far it's in Javascript but I don't mind looking into other things.
__________________
Soft Hardware
OS Windows Media Center Edition 2005
Case Aspire X-Dreamer II
CPU Intel Pentium 4 3.2GHz Prescott 1MB L2-Cache
RAM Patriot Extreme Performance 2048 MB
Video Card Nvidia GeForce 6600 GT 128MB AGP8X
Hard Drive 80 Gigabyte Western Digital
Cooling System 1 - 120mm, 3 - 80mm, 3 - 40mm
CRT Moniter CTX VL700 Series [17" CRT] 1024 x 768 @ 75 Hertz
Power Supply Antec 420w
Disk Drives HP DVD-RW w/ Lightscribe Technology, HP CD-RW, and 3 1/2inch Floppy.
The Infinity's Avatar
Senior Member with 575 posts.
 
Join Date: May 2005
Location: Florida
Experience: Advanced
19-Mar-2007, 05:50 PM #2
Still been looking for an answer to these. Only one I could get a little help on was the IP one. But not enough to get it working.
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
19-Mar-2007, 07:51 PM #3
Run this on a page. It will show you what objects you can use for detecting stuff.

Code:
<script>
for (i in navigator) {
    alert(i);
}
</script>
For Opera, you also have:
Code:
alert(window.opera.version());
alert(window.opera.buildNumber());
java.net.InetAddress.getLocalHost() will get you the computer name and the ip address (if java is enabled)

Last edited by Shadow2531 : 19-Mar-2007 07:57 PM.
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,250 posts.
 
Join Date: Oct 2006
20-Mar-2007, 10:06 AM #4
I know you can do that in php.
The Infinity's Avatar
Senior Member with 575 posts.
 
Join Date: May 2005
Location: Florida
Experience: Advanced
20-Mar-2007, 04:18 PM #5
Thanks for the feedback guys.

I have some good news. I was able to finally get some of them working by looking through various websites and taking bits of script here and there.

I now have the following:
IP
Resolution
Browser <--- kinda
Java Enabled

I would like to have my website display the following (This is an example of how I would like it to look).

IP: 73.274.21.875
Resolution: 1440 x 900
Browser: Mozilla Firefox 2.0
Operating System: Windows XP
Java Enabled?: Yes
Cookies Enabled?: No


So something very similar to what is above. The browser one I am having a bit of trouble condensing to just say the main part instead of like "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2".

I haven't been able to find a single OS checker yet to just show the OS version as above.

And I can't seem to get a Cookie checker that will work either. If you guys can help me find or create any of these I would be greatly appreciative.
__________________
Soft Hardware
OS Windows Media Center Edition 2005
Case Aspire X-Dreamer II
CPU Intel Pentium 4 3.2GHz Prescott 1MB L2-Cache
RAM Patriot Extreme Performance 2048 MB
Video Card Nvidia GeForce 6600 GT 128MB AGP8X
Hard Drive 80 Gigabyte Western Digital
Cooling System 1 - 120mm, 3 - 80mm, 3 - 40mm
CRT Moniter CTX VL700 Series [17" CRT] 1024 x 768 @ 75 Hertz
Power Supply Antec 420w
Disk Drives HP DVD-RW w/ Lightscribe Technology, HP CD-RW, and 3 1/2inch Floppy.
The Infinity's Avatar
Senior Member with 575 posts.
 
Join Date: May 2005
Location: Florida
Experience: Advanced
22-Mar-2007, 11:39 PM #6
I seem to have found a script that does just about everything I want. My only problem is I can't seem to get it to work. I get call errors when I try to change the things it tells me to do.

Here is the link: http://techpatterns.com/downloads/ph..._detection.php

and here is the script:

Code:
<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>
Perhaps I am a bit unclear of how to do it. It seems easy enough but I can't seem to figure it out. If someone could walk me through it quickly I would very much appreciate it.

Thanks.
__________________
Soft Hardware
OS Windows Media Center Edition 2005
Case Aspire X-Dreamer II
CPU Intel Pentium 4 3.2GHz Prescott 1MB L2-Cache
RAM Patriot Extreme Performance 2048 MB
Video Card Nvidia GeForce 6600 GT 128MB AGP8X
Hard Drive 80 Gigabyte Western Digital
Cooling System 1 - 120mm, 3 - 80mm, 3 - 40mm
CRT Moniter CTX VL700 Series [17" CRT] 1024 x 768 @ 75 Hertz
Power Supply Antec 420w
Disk Drives HP DVD-RW w/ Lightscribe Technology, HP CD-RW, and 3 1/2inch Floppy.
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,250 posts.
 
Join Date: Oct 2006
23-Mar-2007, 07:02 AM #7
This is a good place to start. http://media.xenweb.net/tutorials.phtml?ipcheck
The Infinity's Avatar
Senior Member with 575 posts.
 
Join Date: May 2005
Location: Florida
Experience: Advanced
24-Mar-2007, 01:50 AM #8
Well I already have the IP address one as stated above.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:17 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.