Ciao a tutti, sto cercando di sistemare nelle mie pagine uno script che ho trovato nella rete (http://www.codetoad.com/asp/tell_a_friend.asp); quello che vorrei fare è includere lo script nel footer.asp in modo che il link di "segnala questa pagina ad un amico" compaia in tutto il sito e quindi in tutte le pagine.

Il codice che ho trovato sembra avere dei problemi; in particolare l'url da cliccare è errato (compare ")) e anche quando sono riuscito ad aprire la pagina di invio, pur arrivando mi la mail non mi mette l'url corretta della pagina da cui proviene; lo posto qui, qualcuno mi può aiutare? Grazie.


Questo è il codice che ho inserito nel footer.asp e che richiama la pagina 'tell_a_friend_script.asp


<html>

<head>
<script language="javascript">
function TellFriend(ref)
{
var str="toolbar=no,status=no,menubar=no,location=no,s crollbars=yes,resizable=yes,height=320,width=500"
tellaFriend = window.open(ref,"TellObj",str);
tellaFriend.opener = top;
}

</script>
<title>Tell a friend about this page</title>
</head>

<body>

')">Tell a friend about this page!




</p>

</body>

</html>



Questa invece è la pagina 'tell_a_friend_script.asp



<HTML>
<HEAD>
<TITLE>codetoad.com: Tell a Friend</TITLE>




<%



page=""
qs=Request.ServerVariables("query_string")
if len(qs)>0 then
page=right(qs, len(qs)-5)
end if

if page="" then
page=Request.form("page")
if page="" then
Response.Write "Error1"
Response.End
end if
end if

if Request.Form("fromEmail")="" then
showForm
else
sendEmail
end if


sub showForm


%>

<HTML>
<HEAD>
<TITLE>Codetoad.com: Tell a Friend</TITLE>




<script language="JavaScript">
<!--
window.focus();
// -->
</script>
</HEAD>
<body bgcolor="#FFFFFF" link="#003399"
alink="#FF3366" vlink="#003399" text="#000000">

<table border=0 cellpadding=5 cellspacing=5 width=95% >
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="#99ccff">
<tr>
<td><font face="verdana, arial"
size="2"> Tell a Friend</font></td>
</tr>
<tr>
<td>
<table border=0 cellpadding=5 cellspacing=0 width=100% bgcolor="#ffffff">
<tr>
<td valign="top">
<font face="verdana, arial" size="1">
Use the form below to send your
friend an e-mail telling them about this page
(we do not store
the email addresses and will never
contact you using email addresses entered only in tell-a-friend)
</font></td>
</tr>
<TR>
<td>
<table border=0 cellpadding=0 cellspacing=0>
<TR>
<td align="left">
<form action="tell_a_friend_script.asp" method="POST">
<font face="verdana, arial" size="2">
<nobr>Your e-mail: </nobr>
</font></td>
<td align="left">
<input type="Text" name="fromEmail"
value="" size="32" maxlength="255">
</TD>
</tr>
<TR>
<td align="left">
<font face="verdana, arial" size="2">
<nobr>Your friend's e-mail: </nobr>
</font></td>
<td align="left">
<input type="Text" name="toEmail"
value="" size="32" maxlength="255">
</TD>

</tr>
<TR>
<td align="left" valign=top>
<font face="verdana, arial" size="2">
<nobr>Additional Message: </nobr>
</font></td>
<td align="left">
<textarea name=message maxlength=500
cols=24 rows=5></textarea>

</td>
</tr>
<TR><td height="5" colspan="2"></td></tr>
<TR>
<td></td>
<td align="left" valign="top">
<input type="hidden" name="page" value="<%=page%>">

<input type="Submit" value="Send It"></td></tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>




</BODY>
</HTML>
<%


end sub



sub sendEmail


fromEmail=Request.Form("fromEmail")
toEmail=Request.Form("toEmail")
message=Request.Form("message")
page=Request.Form("page")

Dim objNewMail

Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = fromEmail
objNewMail.To = toEmail

objNewMail.Subject = "Ti segnalo questa pagina"
strBody = "Hi,"&Vbcrlf&Vbcrlf
strBody=strBody & fromEmail &" asked us to forward a message to you because "
strBody=strBody & "they thought you might be interested in the following free "
strBody=strBody & "script tutorial at Codetoad.com: "&vbcrlf&vbcrlf&page&vbcrlf&vbcrlf
strBody=strBody&"_________________________________ _________"&vbcrlf&Vbcrlf
strBody=strBody& fromEmail & " wrote : " &vbcrlf&Vbcrlf
strBody=strBody&message&vbcrlf&vbcrlf
strBody=strBody&"_________________________________ _________"&vbcrlf
strBody=strBody&"codetoad.com"&vbcrlf
strBody=strBody&"http://www.codetoad.com"
objNewMail.Body=strBody
objNewMail.Send
Set objNewMail = Nothing



%>

<html>
<body bgcolor="#FFFFFF" link="#003399"
alink="#FF3366" vlink="#003399" text="#000000">

<table border=0 cellpadding=5 cellspacing=5 width=95% >
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="#99ccff">
<tr>
<td><font face="verdana, arial" size="2">
Tell a Friend
</font></td>
</tr>
<tr>
<td>
<table border=0 cellpadding=5 cellspacing=0 width=100% bgcolor="#ffffff">
<tr>
<td align="left" valign=top>
<font face="verdana, arial, helvetica" SIZE="2">
Thanks! An e-mail has been sent to <%=toEmail%>
telling them about this page. We appreciate
you taking the time to help spread the word
about Codetoad.com.



Note: This message is not a guarantee of delivery.



Close this window
</font></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>




</BODY>
</HTML>

<%


end sub%>