Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I log all of the IP's that visit the site into another site?

Status
Not open for further replies.

Tejanorey

Technical User
Mar 23, 2002
219
US
I would like to know if this can be done with script.

Once somebody visits the website...

There IP (and other browser info, javascript enabled yes no, et.) to another webpage...

..the other webpage will act as a log...it will show a list of all of the IP's and other general info...

Thanks Guys!

Tejanorey

"Do not attack the First Marine Division. Leave the yellowlegs alone. Strike the American Army."
- Orders given to Communist troops in the Korean War; shortly afterward, the Marines were ordered to not wear their khaki leggings to keep the enemy from immediately fleeing
 
you'll need to use a server side scripting langauge to get that information, but yes to the question on if you can get all IP's that hit the site

_____________________________________________________________________
onpnt2.gif

 
So is there a way to use a script (the one below is just an example) and have it save the info it captures to another webpage...

I'm using a free webhost..and wondering if this is possible throught that route...


Code:
<!-- ONE STEP TO INSTALL IP ADDRESS:

  1.  Copy the coding into the HEAD of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<HEAD>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! [URL unfurl="true"]http://javascript.internet.com[/URL] -->

<!-- Begin
// [URL unfurl="true"]http://www.kdcgrohl.com[/URL]

// Depending on your server set-up,
// you may need to use the &quot;.shtml&quot;
// extension [instead of the &quot;html&quot;
// or &quot;htm&quot;] as the script uses Server
// Side Includes. To display in the
// title bar, exclude the
//&quot;<title></title>&quot; code from the page.

// This part gets the IP
var ip = '<!--#echo var=&quot;REMOTE_ADDR&quot;-->';

// This part is for an alert box
alert(&quot;Your IP address is &quot;+ip);

// This part is for the status bar
window.defaultStatus = &quot;Your IP address is &quot;+ip;

// This part is for the title bar
document.write(&quot;<title>Your IP address is &quot;+ip+&quot;</title>&quot;);
//  End -->
</script>


<p><center>
<font face=&quot;arial, helvetica&quot; size&quot;-2&quot;>Free JavaScripts provided<br>
by <a href=&quot;[URL unfurl="true"]http://javascriptsource.com&quot;>The[/URL] JavaScript Source</a></font>
</center><p>

<!-- Script Size:  1.09 KB -->

Tejanorey

&quot;Do not attack the First Marine Division. Leave the yellowlegs alone. Strike the American Army.&quot;
- Orders given to Communist troops in the Korean War; shortly afterward, the Marines were ordered to not wear their khaki leggings to keep the enemy from immediately fleeing
 
well what you have there is not very browser friendly but if you're not worried about that
<SCRIPT>
var ip = new java.net.InetAddress.getLocalHost();
var ipStr = new java.lang.String(ip);
document.writeln(ipStr.substring(ipStr.indexOf(&quot;/&quot;)+1));
</SCRIPT>

now to write it to a seperate page, you can 1) pass it in the querystring and parse it with javascript in the next page hence writing it out, but that is fairly of a advanced task (but by all means a writable task for a beginner)
you can see it done here

now to write it to the other page while staying in the originating page you need to reference the object collection or such.
eg:
window
-parent
-child

relationships. this again is a fairly more advanced task but seaching for these types of scripts should yeild plenty of prewrites for you

_____________________________________________________________________
onpnt2.gif

 
ONPNT..

..your awesome..

I'll look into it..

Tejanorey

&quot;Do not attack the First Marine Division. Leave the yellowlegs alone. Strike the American Army.&quot;
- Orders given to Communist troops in the Korean War; shortly afterward, the Marines were ordered to not wear their khaki leggings to keep the enemy from immediately fleeing
 
Or you could use a third party component like this one called BrowserHawk:


It's server side so AFAIK you would need ASP-enabled hosting. But it also means it would be more reliable.

Posting code? Wrap it with code tags: [ignore]
Code:
[/ignore][code]CodeHere
[ignore][/code][/ignore].
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top