Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 19, 2022, 04:44:13 AM

Login with username, password and session length
Members
  • Total Members: 3843
  • Latest: Tricky
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 51
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 0
Guests: 44
Total: 44

Author Topic: E-Mail This Page Script  (Read 6153 times)

0 Members and 1 Guest are viewing this topic.

akulion

  • Guest
E-Mail This Page Script
« on: September 13, 2006, 07:17:39 AM »
Hi

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):

Code: [Select]

<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>
</table>
</form>


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.

Aku

PS...

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


« Last Edit: September 13, 2006, 07:21:50 AM by akulion »

Offline IchBin

  • Friends
  • *
  • Posts: 16231
Re: E-Mail This Page Script
« Reply #1 on: September 13, 2006, 07:35:36 AM »
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.

akulion

  • Guest
Re: E-Mail This Page Script
« Reply #2 on: September 13, 2006, 07:38:10 AM »
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 on..so 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?

thanks

Polymath

  • Guest
Re: E-Mail This Page Script
« Reply #3 on: March 16, 2007, 11:58:24 AM »
How do I stop it from checking names and email... I get not correct errors.

Any idea?

Offline IchBin

  • Friends
  • *
  • Posts: 16231
Re: E-Mail This Page Script
« Reply #4 on: March 16, 2007, 12:10:30 PM »
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.

Code: [Select]
$status = "OK";
$msg="";
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";}

Polymath

  • Guest
Re: E-Mail This Page Script
« Reply #5 on: March 16, 2007, 10:08:46 PM »
   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
« Last Edit: March 16, 2007, 10:41:00 PM by Polymath »

Solomon

  • Guest
Re: E-Mail This Page Script
« Reply #6 on: June 07, 2007, 04:10:38 AM »
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.
« Last Edit: June 07, 2007, 05:04:39 AM by Solomon »