Hey,
Is this possible? I think I had this before, but forgot code.
Example: On a contact form, it would show the persons IP number saying like:
"your IP Number will be sent with the email" etc.
++REP for help.
Printable View
Hey,
Is this possible? I think I had this before, but forgot code.
Example: On a contact form, it would show the persons IP number saying like:
"your IP Number will be sent with the email" etc.
++REP for help.
If I can remember correctly, you can't do it. HTML is client side and doesn't have anything to do with the server (it's just a page on the server). You can use PHP though.
Just edit that, and you should be done.Code:<script language="JavaScript">
VIH_BackColor = "palegreen";
VIH_ForeColor = "navy";
VIH_FontPix = "16";
VIH_DisplayFormat = "You are visiting from:<br>IP Address: %%IP%%<br>Host: %%HOST%%";
VIH_DisplayOnPage = "yes";
</script>
<script language="JavaScript" src="http://scripts.hashemian.com/js/visitorIPHOST.js.php"></script>
URL = http://www.hashemian.com/tools/visitor-IP.htm
But, there is a much simpler one here http://www.wallpaperama.com/forums/h...user-t399.html
Thanks,
++++++++rep lol :)
If it's on a contact form chances are it's PHP.
PHP Code:<?php
$ip = $_SERVER['REMOTE_ADDR'];
echo ('Your IP is: <br />$ip');
?>
Possible via Javascript:
either use document.write or use a popup to display it ;).Code:var ip = '<!--#echo var="REMOTE_ADDR"-->';
Use the PHP one because some people have javascript disabled.
You can use either javascript/php.
Personally, I would go for PHP. Simply renaming the page to .php and adding a little code (I'd do it like this):
That would appear something like this:PHP Code:<?php
$ip = $_SERVER['REMOTE_ADDR'];
echo "<i>Your IP address has been logged: " . $ip . ".</i>";
?>
Your IP address has been logged: 11.22.33.44
And could simply be put at the bottom of the form.
You can also simply add this to the area of the form coding that stores the data submitted in the form as variables (if PHP):
And this would register the visitor's ip as a variable ($ip), and if it's something like submitting an email, you just add it to the email like all the other variables ie. name etc.PHP Code:$ip = $_SERVER['REMOTE_ADDR'];
Hope I've helped.
why not just
instead of adding all your wacky YOUR IP IS" . $IP OH GOD SET A VARIABLE FOR SOMETHING THAT NEVER CHANGESPHP Code:<?php echo $_SERVER[ 'REMOTE_ADDR' ]; ?>
Rofl, Jewish Bear makes me laugh every time. I'm loving the use of wacky. Anyway, glad to see it's been sorted. I'd say PHP is best.
That's a server side include that for some reason has been combined with javascript. You could just do:
Both examples require certain configurations to work, otherwise every XSS vulnerability would be alot more serious.HTML Code:Your IP is: <!--#echo var="REMOTE_ADDR"-->
I tried "<!--#echo var="REMOTE_ADDR" -->"
It does not work..
Fighting over single and double quotes...
Oh Kk. Thank you :)
+rep
fnx i lyk 2
No need to bump the thread?
Can a MOD close thread please :P
If you just want to use HTML, you can use a iFrame which loads a page on another server, such as whatsmyip.org position the iFrame loading page to only load the section which displays the IP address.
That's a good idea AlexBrooks. Thanks :) +rep