HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media


Welcome to TinyPortal. Please login or sign up.

June 05, 2023, 05:18:15 AM

Login with username, password and session length
  • Total Members: 3,864
  • Latest: Joonoz
  • Total Posts: 194,365
  • Total Topics: 21,157
  • Online today: 106
  • Online ever: 3,540
  • (September 03, 2022, 01:38:54 AM)
Users Online
Users: 0
Guests: 71
Total: 71

E-Mail This Page Script

Started by akulion, September 13, 2006, 02:17:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.



Ok this is a nice little thingie - what it does is wherever you place the form for it it will take the address of that page and send it via e-mail to whoever you want.

So this way your users can recommend a specific page to people

This little thingie is best used with articles to recommend individual articles to people.

Download this file and upload to ur forum root, customizations can be done inside the php file to change web address and message

Place at the end of your articles this code (i havent used articles much but you must place this in the template itself):

<form method=post action=tellck.php>
      <table  border="0" cellpadding="0" cellspacing="0" align=center>
<tr bgcolor='#f1f1f1'><td colspan=2 align=center><font face='Verdana' size='2' ><b>TELL A FRIEND</b></font></td></tr>

<tr><td width=100><font face='Verdana' size='2' >Your Name</font></td><td width=200><input type=text name=y_name></td></tr>
<tr bgcolor='#f1f1f1'><td><font face='Verdana' size='2' >Your Email</font></td><td><input type=text name=y_email></td></tr>
<tr ><td><font face='Verdana' size='2' >Your Friend's Name</font></td><td><input type=text name=f_name></td></tr>
<tr bgcolor='#f1f1f1'><td><font face='Verdana' size='2' >Friend's Email</font></td><td><input type=text name=f_email></td></tr>
<tr ><td><font face='Verdana' size='2' >Your Message</font></td><td><textarea name=y_msg rows=5 cols=20></textarea></td></tr>

<tr bgcolor='#f1f1f1'><td colspan=2 align=center><font face='Verdana' size='2' ><input type=submit value='Send'></font></td></tr>

You can modify the code as necessary to suit colors etc...

A crappy lil demo cn be found on this page - i was just testing stuff so the page looks crap..just browse to the bottom to see it

sorry i havent provided details about hot to integrate into the articles template, but i dont use articles so ull have to ask one of the other support guys.



oh yea i forgot to mention, thats a working demo so you can email yourself to see how it works :)


Thats very cool! What would be a nice feature is if it was a link at the bottom of an article, and when the link is clicked it dynamically opens the form without having the reload the page.


yea i tried using IFRAME but failed up till now

the problem arises because the script will only take the addy of the page it is located if you place it as a stand alone, it recommends the form address

im thinking maybe something like a "collapsed block" when u click it - it opens the form up...that way it will already be on that page

Also Ichbin can you shed some light about how to integrate this into the articles template if u have the time please?



How do I stop it from checking names and email... I get not correct errors.

Any idea?


What are you getting an error on? The email or name is not correct?

in the tellck.php file you'll see this code which verifies all your input.

$status = "OK";
if (!stristr($y_email,"@") OR !stristr($y_email,".")) { // checking your email
$msg .="Your email address is not correct<BR>";
$status= "NOTOK";}

if (strlen($y_name) <2 ) { // checking your name
$msg .="Please enter your name<BR>";
$status= "NOTOK";}

if (!stristr($f_email,"@") OR !stristr($f_email,".")) { // checking friends email
$msg .="Your Friends address is not correct<BR>";
$status= "NOTOK";}

if (strlen($f_name) <2 ) { // checking freinds name
$msg .="Please enter your friend's name<BR>";
$status= "NOTOK";}

if (strlen($y_msg) <2 ) { // checking Message details
$msg .="Please enter your message details<BR>";
$status= "NOTOK";}


   Damn this not work for me..ohhh well

Your email address is not correct
Please enter your name
Your Friends address is not correct
Please enter your friend's name
Please enter your message details


It works as advertised.
However, what would be *really* good is a simple 'Email this page to a friend' link, such as found on every page of the BBC site.
Perhaps the script here can be adjusted to run on its own page, and the template modded to run just the hyperlink.