Web Hosting Talk







View Full Version : Display IP Address in form


brianlim
05-28-2003, 11:25 AM
Hi,

I am currently creating a form.
I wanted to display the sender IP address on the form.
And also received the sender's IP address when i received the form sent by the user.
Anybody know how can i do it or is there any site which have this kind of scripts?

Please Advice.

Thanks a lot!!! ;)
Cheers!

worldhive
05-28-2003, 11:39 AM
I don't exactly understand what you are trying to do...

If the client is coming to a web page, all you have to do is stick in this piece of code where you want the IP address displayed: <?=$_SERVER['REMOTE_ADDR']?>. You can then put this inside a form element, or if you want a printed form for example, you could append that to the content that you are passing through PDFlib/fpdf.

The word 'sender' makes me think via email? If this is the case than you can parse for X-Sender-IP, but it isn't generally included.

Clarify a little and I'll see what I can do to help.

-Paul