TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 05:57:08 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,106
  • Total Topics: 21,213
  • Online today: 358
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 295
  • Total: 296
  • @rjen

Invite A Friend Block [side block]

Started by akulion, April 12, 2007, 05:49:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

akulion

Demo: http://path-to-peace.com/forum2/

How To:

1 - Download image and php file attached

2 - Open php file and alter these lines:

<META HTTP-EQUIV=REFRESH CONTENT="6;URL=http://path-to-peace.com/community">

Replace the address with your homepage (this is where the redirect takes place after sending the email) - Also the 6 is the time in seconds it takes to redirect, you can change it if you want.

Also in the same file find:

if you are not diverted in 10 seconds please <a href='http://path-to-peace.com/community/'>

Replace the address for your own

3- Place the following code in a SCRIPT SIDE BLOCK

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

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

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


4 - Recommended settings for block: Use frame but not title.

5 - Upload both files (1 image and 1 php file) attached to this post to your forum root (directory where your forum is installed)

6 - Activate the block and enjoy.


akulion

oh i nearly forgot...

in the PHP file this line defines what message to send

$header_message = "Peace $f_name \n Your friend $y_name has sent you the following message and requested you to visit the page at \n $ref \n";

Dont touch the variables starting with the $ sign, the rest u can change

rebelrose


madagascar

#3
I already implemented this feature but why i've got this error on my page before it will show my homepage?

Thanks.

ERROR:
"; $status= "NOTOK";} if (strlen($y_name) <2 ) { // checking your name $msg .="Please enter your name
"; $status= "NOTOK";} if (!stristr($f_email,"@") OR !stristr($f_email,".")) { // checking friends email $msg .="Your Friends address is not correct
"; $status= "NOTOK";} if (strlen($f_name) <2 ) { // checking freinds name $msg .="Please enter your friend's name
"; $status= "NOTOK";} if (strlen($y_msg) <2 ) { // checking Message details $msg .="Please enter your message details
"; $status= "NOTOK";} if($status=="OK"){ // all validation passed /////////// Sending the message starts here ////////////// $ref=@$HTTP_REFERER; /////Message at the top of the page showing the url//// $header_message = "Peace $f_name \n Your friend $y_name has sent you the following message and requested you to visit the page at \n $ref \n"; /// Body message prepared with the message entered by the user //// $body_message =$header_message."\n".$y_msg."\n"; $body_message .="\n "; //// Mail posting part starts here ///////// $headers=""; //$headers = "Content-Type: text/html; charset=iso-8859-1\n".$headers; // Un comment the above line to send mail in html format $headers4=$y_email; // Change this to change from address $headers.="Reply-to: $headers4\n"; $headers .= "From: $headers4\n"; $headers .= "Errors-to: $headers4\n"; $subject="Request to visit URL"; mail($f_email,$subject,$body_message,$headers); ////// Mail posting ends here /////////// echo "

Thank You, Your message has been emailed to $f_name
"; echo "
You are being redirected back to the main page, if you are not diverted in 10 seconds please click here

Or Click the back button on your browser to return to the previous page
"; //////////// Sending the message ends here ///////////// }else{// display the error message echo "
$msg
"; } ?>

GP

The script is not recognizing the form inputs when I try it.  Each time I get.....


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


It works like a charm on Gobo's site.  What am I overlooking?  :-\

rebelrose


GP


rebelrose


jiminoregon

Quote from: GP on July 04, 2007, 04:05:54 AM
The script is not recognizing the form inputs when I try it.  Each time I get.....


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


It works like a charm on Gobo's site.  What am I overlooking?  :-\


I'm getting the same result...have you come up with an answer Gobo?

Thanks,

Jim

arrisje

I tried this one to and did not work for me neither. My forum is using gmail. Is there a possibility to use that somewhere in this code?
Thanks for all the great help I have been getting on this board. :)
B.T.W. Here is my forum http://arrisje.110mb.com/Forum/index.php