Click to See Complete Forum and Search --> : mlm linking


Danny
01-17-2003, 08:04 PM
I'm looking for a java script that will allow me to send a link in a e-mail that when the link is clicked on, the link can get say the users id number out of the link.

I need help!!!

Danny

khalidali63
01-17-2003, 08:15 PM
The code sgment below should take care of that for you

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<head>
<title>Untitled</title>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>MAIL TO FORM!</title>
<script>
function emailVariableValue(){
var frm = document.forms;
var subject = "This email is being sent using a function by variables"
var body = document.getElementsByTagName('a')[0].href;
frm[0].action = "MAILTO:yourEmail@domain.com\?subject\="+subject+"&body="+body+";";
return true;
}
</script>
</head>
<body bgcolor="a1c3a1">

<form name="comments" method="POST" onsubmit="return emailVariableValue();" enctype="text/plain">
Thanks for taking some time to send me your views
<a href="www.cnn.com">CNN</a>
<input type="Submit" value="Submit"> <input type="RESET"></p>
</form>
</body>
</html>

Danny
01-17-2003, 10:37 PM
Tried the code but doesn't get the results that I need.

There has to be a way that when a person is sent an e-mail with a link in the e-mail say
http://www.ltw.net/free.html?id=777
When you click on the link how can I get the page free.html to get the id number 777?

Thanks
Danny

Danny
01-17-2003, 10:44 PM
Tried the code but doesn't get the results that I need.

There has to be a way that when a person is sent an e-mail with a link in the e-mail say
http://www.ltw.net/free.html?id=777
When you click on the link how can I get the page free.html to get the id number 777?

Thanks
Danny

pyro
01-17-2003, 11:39 PM
If I'm understanding you correctly, you want to parse the link to get the 777, correct? If so you can use split to split the location at the ? and then, resplit to split at the =. End result, 777. If this is what you are looking for, I can explain how to do this.

Danny
01-17-2003, 11:44 PM
This is exactly what I'm looking for.

pyro
01-17-2003, 11:52 PM
This will return 777 (or anything after the =) into the finallocation variable. Right now, I just alert it, so you can see that it works. If you have any questions, let me know.

<script type="text/javascript">
var location = document.location.href;
var sublocation = location.split("?");
var newsublocation = sublocation[1].split("=");
var finallocation = newsublocation[1];
alert (finallocation);
</script>

Danny
01-18-2003, 12:03 AM
This is great. Thanks:D :D

pyro
01-18-2003, 12:06 AM
Certainly :D