473,405 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Send user's IP address via submitted form

I want to extract the user's IP address and put it into my form
without him/her knowing about it.

I have Javascript code (see below)
to get the user's "start time", which works just fine
(i.e., it's the time he/she accessed the web page).

I added "IP_ADDR" and corresponding code
that I got from web searches,
but can't figure out how to get it to work correctly
(all I get in the result e-mailed form is "IP_ADDR = (blank)").

Any help would be greatly appreciated!

================
<HTML>
<snip>

<SCRIPT LANGUAGE="JavaScript">
<!-- hide from non-Java browsers
<snip>

window.onload=function ()
{
var now=new Date();

document.forms[document.forms.length-1].START_TIME.value =
now.toLocaleTimeString();

document.forms[document.forms.length-1].IP_ADDR.value =
java.net.InetAddress.getLocalHost().getAddress();
}
<snip>
// end hiding

<snip>
<FORM NAME="TEST" METHOD="POST" ACTION="mail.pl">
<snip>
<INPUT TYPE="hidden" NAME="START_TIME">
<snip>
<INPUT TYPE="hidden" NAME="IP_ADDR">
<snip>
<INPUT TYPE="submit" NAME="Submit" VALUE="SUBMIT">
<snip>
</FORM>
<snip>
</HTML>

-----
Bond . . . James Bond
Do not reply via e-mail.
The address is phony to prevent spam, etc.
Thank you for understanding.
Jul 23 '05 #1
2 3517
James Bond 007 wrote:
I want to extract the user's IP address and put it into my form
without him/her knowing about it.

I have Javascript code (see below)
to get the user's "start time", which works just fine
(i.e., it's the time he/she accessed the web page).

I added "IP_ADDR" and corresponding code
that I got from web searches,
but can't figure out how to get it to work correctly


'cos it doesn't anymore.

Your server can detect the IP address assigned by the user's ISP, but
that will change each time they connect and will rarely (if ever) be
the actual IP of a user's machine on their local network.

The only reliable way to track users is to make them login with a user
ID and password. Even then, if users share login details, you don't
know exactly who is doing what.

--
Fred
Jul 23 '05 #2
On Thu, 23 Dec 2004 09:40:48 +1000, Fred Oz <oz****@iinet.net.auau>
wrote:
James Bond 007 wrote:
I want to extract the user's IP address and put it into my form
without him/her knowing about it.

I have Javascript code (see below)
to get the user's "start time", which works just fine
(i.e., it's the time he/she accessed the web page).

I added "IP_ADDR" and corresponding code
that I got from web searches,
but can't figure out how to get it to work correctly
'cos it doesn't anymore.

Your server can detect the IP address assigned by the user's ISP, but
that will change each time they connect and will rarely (if ever) be
the actual IP of a user's machine on their local network.

The only reliable way to track users is to make them login with a user
ID and password. Even then, if users share login details, you don't
know exactly who is doing what.

--
Fred


Oh!

Thanks!

-----
Bond . . . James Bond
Do not reply via e-mail.
The address is phony to prevent spam, etc.
Thank you for understanding.
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to...
3
by: Sam | last post by:
Hi...I was wondering if it is possible to send an email containing data caught in an HTML form, without using ASP (as my ISP doesn't support ASP). Thanks.
1
by: Nicolae Fieraru | last post by:
Hi All, I am working on a script and I have a form to a page to be submitted (POST-ed) to an external site. I need that when the user submits the form, first step is to send an email using an...
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
2
by: mcraven.2 | last post by:
How do you send a browser to a link when a command is given? I've tried using Java Server Pages <jsp:forward /command but that doesn't change the link in the address bar and some other problems...
1
by: chaitanya02 | last post by:
Hi All, Well- this question might have appeared several times on this forum- but would appreciate your reply on this: I have a asp page, where customers login with some username and the pwd,...
16
by: bgreer5050 | last post by:
I have a form with the following fields: UserEmail Subject Body When the form is submitted, the email is processed fine. When I try to add another field to the mm.body (mm.Body = Body.Text...
3
by: shybe | last post by:
Ok, Im trying to create a "send this article to a friend" script for my blog, Right now its sending all the articles, but I want it to only send the article in which the form is attached...
7
by: canajien | last post by:
How can I get a php page to automatically send all the contents in an email when it is generated? I managed to hack together a script that sends an email, but it will only send the 1st record...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.