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

Rushil Paul
07-29-2009, 09:31 AM
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() {

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!">

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: