|
|
Home » ASP » Article
ASP Tell a Friend Script
|
| Article by: | Jeff Anderson ( 1362 ) (10/15/2001) |
|
| Sponsored by: |
Neil Matthews Hypnotherapy, Wilmslow |
| Summary: | This is an ASP Script simply to be used on your pages to allow users to email an article or page they've seen on your site. This Script also use JavaScript to validate the form. |
|
| Viewed: 48107 times |
Rating (4 votes): |
|
3.9 out of 5 |
|
|
|
Tell-a-friend scripts are used to allow surfers to pass on details of the page
they are visiting to
their friends via a neat pop up box. This brings more precious traffic to your site
and makes it look that little bit more professional.
First you will need to create a javascript pop-up function :
Let's say we want to provide a tell a friend script for this page http://www.codetoad.com/asp/tell_a_friend.asp
We will need to include the above function in the <head> tag of the page.
Then, to create the link itself we need to encode the current page url
and pass it to the tell_a_friend_script page :
<a href="javascript:TellFriend('http://www.codetoad.com/asp/tell_a_friend_script.asp?page=<%
Response.write server.URLEncode("http://www.codetoad.com/asp/tell_a_friend.asp")
%>')"><B>Tell a friend about this page!</B></a>
Tell a friend about this page!
The page tell_a_friend_script.asp will be the page that appears in the pop up window. To create
the page, the following asp page consists of a form to gather the senders details and message.
The page is submitted itself and displays a thankyou message to the user once the email
has been sent.
|
|
|
|
View highlighted Comments
User Comments on ' ASP Tell a Friend Script'
|
Posted by :
David Bruce at 06:05 on Thursday, November 07, 2002
|
There was a line missing in the javascript which we've now corrected - the code should now work fine!
Cheers
Dave
| |
Posted by :
Archive Import (Robert) at 15:23 on Thursday, November 07, 2002
|
Hi, Dave:
This code is still not working... In the pop up, the "Additional message" box is showing the following code:
</td>
</tr>
<TR><td height="5" colspan="2"></td></tr>
<TR>
<td></td>
<td align="left" valign="top">
<input type="hidden" name="page" value="http://www.amerigold.com/ag_market_report/ag_market_report.asp">
<input type="Submit" value="Send It"></td></tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<p>
</BODY>
</HTML>
| |
Posted by :
Archive Import (Kenny) at 15:09 on Friday, January 10, 2003
|
Hi yea,
I have mine working but http://www.spudnic.com for the sample , but is there anything I can to to give me the complet address ie http://localhost/swan_server/pics2.asp?imgdate=12/24/02 and not just http://localhost/swan_server/pics2.asp , If you could do anything I would be grateful. regards
Kenny
| |
|
|
|
|
Posted by :
Archive Import (elvis) at 06:37 on Friday, January 24, 2003
|
I tried the above code, it works but it taqkes ages for the window to pop up, it is not my ISP as far as i am aware as all my other pop up windows work a treat. any ideas.
thank you very much
Elvis
| |
Posted by :
Archive Import (Kenny) at 07:38 on Friday, January 24, 2003
|
Well it kinda works but I thought it was going to pass the http_referer , ie the email being sent would contain the full http address along with the query string but sadly this is not the case, this script seems to only send a fixed http address which the web master has to olace in the code first. if any one here knows where I can get a good pop up send to friend code that sends the full address of a page on completion of a form I would be most grateful, I have being on this for the lst two weeks and it is really driving me behind.
Regards
Kenny
| |
Posted by :
Archive Import (Thomas) at 09:13 on Thursday, May 08, 2003
|
Can't this be done much easier with an ASP mailsender script?
| |
Posted by :
Archive Import (Melody) at 20:15 on Thursday, June 05, 2003
|
This script is still messed up and still showing the following in additional comments box:
</td>
</tr>
<TR><td height="5" colspan="2"></td></tr>
<TR>
<td></td>
<td align="left" valign="top">
<input type="hidden" name="page" value="http://www.amerigold.com/ag_market_report/ag_market_report.asp">
<input type="Submit" value="Send It"></td></tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<p>
</BODY>
</HTML>
| |
Posted by :
Archive Import (Tim) at 14:04 on Saturday, July 12, 2003
|
This script looks like it will be sweet if it worked right.. I don't know enough about ASP yet to fix it but I am still getting HTML tags in the message box... If I could help I would.. Good Luck Guys.
| |
Posted by :
Archive Import (marc) at 18:06 on Friday, August 08, 2003
|
HTML tags in the message box...
In approx line 107 of the code you will find "%gt;" after the 5. Replace this with > and the code should work.
eg..
it now reads
<textarea name=message maxlength=500 cols=24 rows=5%gt;</textarea>
should read
<textarea name=message maxlength=500 cols=24 rows=5></textarea>
| |
Posted by :
clasico at 11:38 on Thursday, December 25, 2003
|
Hello -- I noticed a small typo in the code for the tell_a_friend_script.asp
In the section for the textbox, the code has the following:
<textarea name=message maxlength=500
cols=24 rows=5%gt;</textarea>
The code should have a ">" after the "rows=5" -- see example here:
<textarea name=message maxlength=500
cols=24 rows=5></textarea>
Otherwise, without this change, the textbox will show a lot of code.
| |
Posted by :
psjunta at 11:45 on Saturday, June 24, 2006
|
Is it me, or how can you make it call the specific page that it is on? As of now, it only goes to the stated address that you pass from the javascript <a href code.
Thank you for any help!
Paul
| |
|
To post comments you need to become a member. If you are already a member, please log in .
| |