1.
I always wanted to get the ip address of the browser that is surfing my site. i've already used php variables to get that by it always gives me 127.0.0.1, and now i decided to just get the javascripts variables, the problem is how can i make this javascripts variables be converted in php variables,..
<SCRIPT>
var ip = new java.net.InetAddress.getLocalHost();
var ipStr = new java.lang.String(ip);
document.writeln(ipStr.substring(ipStr.indexOf("/")+1));
</SCRIPT>
?Question:how can improve this to get ip address of the user?
- also, my http_referrer variable is not working, i've always used that in my site and still nothing happens, it only gives me blank. thus i also decided to get the javascript document.referrer and succesfully i get the what i want, the referrer address, but unfortunately, i can't convert it to php variable.
<script language=JavaScript>
<!--
document.write('<img src="http://www.polerio.f2s.com/insert.php3?"'+(document.referrer.length > 0 ? document.referrer:"no referrer")
+'" width=1 height=1 border=0>');
document.write("<table><TR><TD VALIGN=TOP><B>User referred from: "
+"<P></TD><TD VALIGN=TOP><B>"
+(document.referrer.length > 0 ? document.referrer:"<i>no referrer</i>")
+"</B></TD></TR></table>");
// -->
</script>
?Question: Can you correct this code to put javascript var to php so that i can insert it into my database?
polerio.f2s.com