Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-29-2009, 09:31 AM   PM User | #1
Rushil Paul
New to the CF scene

 
Join Date: Jul 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rushil Paul is an unknown quantity at this point
Question Capture the ip address of a visitor and SEND IT

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:
Code:
<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:


Code:
<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.
Rushil Paul is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:31 AM.


Advertisement
Log in to turn off these ads.