...

View Full Version : Frustrating email/aspID question



kovalik
08-26-2002, 09:22 PM
I am struggling to get this script to work the way I want. It is supposed to "email this recipe to a friend"
It works except it doesn't include the actual recipe ID (?recipeID=134) so what I get as an address is this:

http://www.recipesplus.ca/recipe.asp (which is always recipe #1)

What I want to do is have it email the specific recipe (including the asp recipe ID) like this:

http://www.recipesplus.ca/recipe.asp?recipeID=134

Thanks very much if you can help,

kovalik

Here's the script:

<SCRIPT>
function Mailit(form) {
window.location.href=("mailto:" + form.address.value + "?subject=A web page to see&body=I found this web page at " + window.location.href + window.location.search + ", which I thought you might like to see.")
return false;
}
</SCRIPT>


<FORM name="Recom" onsubmit="return Mailit(Recom)">
<TABLE>
<TR><TD>Recommend this Web page to a friend</TD></TR>
<TR><TD><INPUT type="text" name="address" size="35" value="Enter Email Address">
<INPUT type="button" name="Button" onclick="Mailit(this.form)" value="Send"></TD></TR>
</TABLE>
</FORM>


:)

beetle
08-26-2002, 09:40 PM
perhaps retrieve the href Before instantiating the process to change it....like this...
function Mailit(form) {
var currUrl = top.location.href;
window.location.href=("mailto:" + form.address.value + "?subject=A web page to see&body=I found this web page at " + currUrl + ", which I thought you might like to see.")
return false;
}

joh6nn
08-26-2002, 09:45 PM
mailto: is extraordinarily unreliable. you're better off using a server-side script.

this:
window.location.href + window.location.search ,
is repetitive. location.href already has location.search in it.

kovalik
08-26-2002, 10:13 PM
I struggle with scripting, I appreciate all your help. Can you point me in the direction I need to go. As in, what kind of server side script I would require? Ill try and go from there.

Thanks for your time.

kovalik



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum