...

View Full Version : Capture the ip address of a visitor and SEND IT



Rushil Paul
07-29-2009, 10:31 AM
Guys,
I have a javascript code that captures the ip address of da visitor and sends it to a page in my website when da visitor clicks a button on da current page.

This is da script:

<script language="javascript">

var ip = '<!--#echo var="REMOTE_ADDR"-->'
function ipval() {
document.myform.ipaddr.value=ip;
}
window.onload=ipval
</script>

and da script which displays da button, which on getting clicked, sends da ip to a page (login.php) is a form with a hidden field and a button:



<form method="post" action="login.php" name="myform">
<input type="hidden" name="ipaddr" readonly>
<input type="submit" name="submit" value="send ip!">
</form>

Now Isn't there any way by which the ip addres of da visitor automatically gets sent to da page login.php as soon as he opens da page??? plz help.:confused::confused:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum