Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 05-15-2013, 01:59 AM   #1
PornMD
Mainstream Businessman
 
PornMD's Avatar
 
Industry Role:
Join Date: Jan 2007
Location: San Diego
Posts: 9,291
Quick question about Javascript without SSI that one of you may have a quick answer for

I'm trying to help someone be able to capture a visitor's IP address hidden in an order form without the ability to use server-side includes (it's a hosted form and the limitations seem to prevent SSI or languages like PHP). I found a nice short JavaScript code that returns IP without SSI:

Code:
<script type="text/javascript" src="http://l2.io/ip.js"></script>
The problem is that putting the code in the value= winds up displaying the code rather than the IP the code would normally return.

Is there ANY way to put in code that will work inside form input value quotes to make the input value the visitor's IP in this case?
__________________
Want to crush it in mainstream with Facebook ads? Hit me up.
PornMD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-15-2013, 05:08 AM   #2
Harvey Specter
Registered User
 
Harvey Specter's Avatar
 
Industry Role:
Join Date: Apr 2013
Posts: 13
Something like this should work..

Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" >
    var backup = document.write;
    var ipaddress = "";
    document.write = function(str) {ipaddress += str;};
</script>
<script type="text/javascript" src="(cant post links)://l2.io/ip.js">  </script>
<script type="text/javascript" >
    document.write = backup;
	function setIP(){
		document.getElementById('formIPaddress').value = ipaddress;
	}
</script>
</head>

<body onload="setIP();">
<form id="formName" name="formName">
<input type="hidden" name="formIPaddress" id="formIPaddress" />
</form>
</body>
</html>
Harvey Specter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-15-2013, 10:02 AM   #3
PornMD
Mainstream Businessman
 
PornMD's Avatar
 
Industry Role:
Join Date: Jan 2007
Location: San Diego
Posts: 9,291
Quote:
Originally Posted by Harvey Specter View Post
Something like this should work..

Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" >
    var backup = document.write;
    var ipaddress = "";
    document.write = function(str) {ipaddress += str;};
</script>
<script type="text/javascript" src="(cant post links)://l2.io/ip.js">  </script>
<script type="text/javascript" >
    document.write = backup;
	function setIP(){
		document.getElementById('formIPaddress').value = ipaddress;
	}
</script>
</head>

<body onload="setIP();">
<form id="formName" name="formName">
<input type="hidden" name="formIPaddress" id="formIPaddress" />
</form>
</body>
</html>
Thanks a lot! They have a limitation in that the HTML code they need this done in is self-contained, i.e. no access to the head or the body tag (similar to if you had to do this entirely through a Wordpress widget that only recognized HTML/Javascript/etc. and not PHP). This is due to this being a hosted page and the system it's created through.

I think if needbe they may be able to switch to a page that can be fully coded. Though in that case, I believe PHP can be used. So I was more trying to see if there was a solution workable within those limitations since changing to a fully coded page AFAIK means changing the URL of the page which presents a whole other set of other things to fix within their order flow. Could this be made workable somehow in the scenario I mentioned?

It felt like there should be a way - using the Javascript code I mentioned in their system did return the IP, so it's just a matter of somehow getting that into the value of a form input.
__________________
Want to crush it in mainstream with Facebook ads? Hit me up.

Last edited by PornMD; 05-15-2013 at 10:07 AM..
PornMD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-15-2013, 03:03 PM   #4
Harvey Specter
Registered User
 
Harvey Specter's Avatar
 
Industry Role:
Join Date: Apr 2013
Posts: 13
Yeah pretty simple with some reworking..
Obviously just change the textbox to a hidden form item when using in production

Code:
<body>
<script type="text/javascript" >
    var backup = document.write;
    var ipaddress = "";
    document.write = function(str) {ipaddress += str;};
</script>
<script type="text/javascript" src="(nolinks)://l2.io/ip.js">  </script>
<script type="text/javascript" >
    document.write = backup;
	function setIP(){
		document.getElementById('textBoxName').value = ipaddress;
	}
	window.onload = setIP;
</script>

<form id="formName" name="formName">
<input type="text" name="textBoxName" id="textBoxName" />
</form>
</body>
Harvey Specter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-15-2013, 07:35 PM   #5
PornMD
Mainstream Businessman
 
PornMD's Avatar
 
Industry Role:
Join Date: Jan 2007
Location: San Diego
Posts: 9,291
Quote:
Originally Posted by Harvey Specter View Post
Yeah pretty simple with some reworking..
Obviously just change the textbox to a hidden form item when using in production

Code:
<body>
<script type="text/javascript" >
    var backup = document.write;
    var ipaddress = "";
    document.write = function(str) {ipaddress += str;};
</script>
<script type="text/javascript" src="(nolinks)://l2.io/ip.js">  </script>
<script type="text/javascript" >
    document.write = backup;
	function setIP(){
		document.getElementById('textBoxName').value = ipaddress;
	}
	window.onload = setIP;
</script>

<form id="formName" name="formName">
<input type="text" name="textBoxName" id="textBoxName" />
</form>
</body>
Thanks again. I just tested this within the system and the field just shows empty. Can't believe how cumbersome this damn thing is. :/

Here is what the source code on the page shows:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>HTML Layer test</title><meta name="robots" content="noindex" />
<script type='text/javascript'>
			var mr_lp_id = 20;
		</script></head>
<body style="font-family: Verdana; font-size: 16px; margin: 0px;padding:0px; background-color: rgb(255,255,255);background-position: top center;"><center><div style='width: 800px; height: 1000px; position: relative;overflow: hidden;'><DIV style="left:1px;top:5px;height:343px;width:456px;position:absolute;overflow: hidden;overflow-y:auto;line-height: 1.25;text-align: left">
			
<script type="text/javascript" >
    var backup = document.write;
    var ipaddress = "";
    document.write = function(str) {ipaddress += str;};
</script>
<script type="text/javascript" src="(nolinks)://l2.io/ip.js">  </script>
<script type="text/javascript" >
    document.write = backup;
	function setIP(){
		document.getElementById('textBoxName').value = ipaddress;
	}
	window.onload = setIP;
</script>

<form id="formName" name="formName">
<input type="text" name="textBoxName" id="textBoxName" />
</form>

</DIV></div></center><script src='http://www1.moon-ray.com/tracking.js' type='text/javascript'></script>
<script>
_mri = "7997_lp20.0_2";
mrtracking(0);
</script></body>
</html>
__________________
Want to crush it in mainstream with Facebook ads? Hit me up.
PornMD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-15-2013, 08:38 PM   #6
helterskelter808
So Fucking Banned
 
Industry Role:
Join Date: Sep 2010
Posts: 3,405
Did you change "(nolinks)" to "http"?

Last edited by helterskelter808; 05-15-2013 at 08:43 PM..
helterskelter808 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-16-2013, 05:12 AM   #7
Harvey Specter
Registered User
 
Harvey Specter's Avatar
 
Industry Role:
Join Date: Apr 2013
Posts: 13
Quote:
Originally Posted by helterskelter808 View Post
Did you change "(nolinks)" to "http"?
this lol
Harvey Specter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.