View Full Version : Send to a friend script i use
thomas
01-09-2006, 11:47 PM
hello again. I hope you think i am god with these awsome business options for your sites and also therefor sometimes your clients!
I use a Send to a friend script for years. It is created by someone else, but they have credit in the copyright of the file.
Upload this file to your skins/SKIN direcotry
[attachmentid=235]
NOTE!! - You will need to change the SETTINGS IN THE FILE!!
$sitename, and $siteaddress
To call the function, use the following code in your skin php.
<script language="Javascript1.2">document.write('<a href="javascript:void(0)" onclick=window.open("http://***URL***/skins/**SKINNAME***/recommend.php?loc='+window.location.href+'","","he ight=280,width=260,top=150,left=200,toolbar=no,men ubar=no,location=no,status=no,resizable=1"); title="Recommend this to a friend" class="style2">Send to a Friend</a>');</script>
NOTE - You will need to change the URL Path
Have fun
72dpi
01-10-2006, 03:29 AM
Thanks Thomas,
Ok, everyone Please Please Please add this code to the recommend page:
This will stop any spambots using the script to mass email.
This code should be put in the <?php ?> tags, before any of the declarations.
// start anti injection
// First, make sure the form was posted from a browser.
****// For basic web-forms, we don't care about anything
****// other than requests from a browser:**
****if(!isset($_SERVER['HTTP_USER_AGENT'])){
****** header("HTTP/1.0 403 Forbidden");
****** die("Forbidden - You are not authorized to view this page");
****** exit;
****}
****
****// Make sure the form was indeed POST'ed:
****//**(requires your html form to use: action="post")
****if(!$_SERVER['REQUEST_METHOD'] == "POST"){
****** header("HTTP/1.0 403 Forbidden");
****** die("Forbidden - You are not authorized to view this page");
****** exit;**
****}
****// Attempt to defend against header injections:
****$badStrings = array("Content-Type:",
************************ "MIME-Version:",
************************ "Content-Transfer-Encoding:",
************************ "bcc:",
************************ "cc:");
****
****// Loop through each POST'ed value and test if it contains
****// one of the $badStrings:
****foreach($_POST as $k => $v){
****** foreach($badStrings as $v2){
********** if(strpos($v, $v2) !== false){
************** header("HTTP/1.0 403 Forbidden");
************** die("Forbidden - You are not authorized to view this page");
********** }
****** }
****}
Also, for the <form method =blah blah
you can use this instead:
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
Thanks THomas, hope this helps some more!
thomas
01-10-2006, 04:45 AM
awsome.
I was wondering why the script didnt have that. Good find.
Terminator1138
01-10-2006, 02:29 PM
<div class='quotetop'>QUOTE(72dpi @ Jan 9 2006, 10:29 PM) 2800</div>
Thanks Thomas,
Ok, everyone Please Please Please add this code to the recommend page:
This will stop any spambots using the script to mass email.
This code should be put in the <?php ?> tags, before any of the declarations.
// start anti injection
// First, make sure the form was posted from a browser.
****// For basic web-forms, we don't care about anything
****// other than requests from a browser:**
****if(!isset($_SERVER['HTTP_USER_AGENT'])){
****** header("HTTP/1.0 403 Forbidden");
****** die("Forbidden - You are not authorized to view this page");
****** exit;
****}
****
****// Make sure the form was indeed POST'ed:
****//**(requires your html form to use: action="post")
****if(!$_SERVER['REQUEST_METHOD'] == "POST"){
****** header("HTTP/1.0 403 Forbidden");
****** die("Forbidden - You are not authorized to view this page");
****** exit;**
****}
****// Attempt to defend against header injections:
****$badStrings = array("Content-Type:",
************************ "MIME-Version:",
************************ "Content-Transfer-Encoding:",
************************ "bcc:",
************************ "cc:");
****
****// Loop through each POST'ed value and test if it contains
****// one of the $badStrings:
****foreach($_POST as $k => $v){
****** foreach($badStrings as $v2){
********** if(strpos($v, $v2) !== false){
************** header("HTTP/1.0 403 Forbidden");
************** die("Forbidden - You are not authorized to view this page");
********** }
****** }
****}
Also, for the <form method =blah blah
you can use this instead:
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
Thanks THomas, hope this helps some more!
[/b]
will this work on all contact forms etc inside sd?
Terminator1138
01-10-2006, 09:14 PM
sorry could get it to work if I included it in a custom plugin, but nothing....anyways.......if my above post could be answered, that would be great. I'm looking for the other links on sd.com site to find what code to add. not sure if its included in future release or not or to updated plugins.
72dpi
01-10-2006, 11:35 PM
Hi terminator,
I will have a play. I haven't added it as yet, but would recommend that you perhaps save the above code as stopthespam.php into a folder called "scripts" or something.
Then just use via an include:
include 'stopthespam.php';
i will have a play with it later to see if it mucks up the contact form. i don't think it will, as I have used this on many forms with no issues. perhaps a "pro's opinion on this would be appreciated?
Terminator1138
01-11-2006, 03:53 AM
I was able to get it to work but the css was all messed up, way small text etc...I added it as a custom plugin and included the file, however trying to figure out how to edit it a bit.....
The spam code was added to it before I uploaded...right now Its all removed to test site for more evalutation
thomas
01-11-2006, 04:28 AM
hmm. ok works fine for me
Brent
04-09-2006, 05:56 PM
(tell a friend / recommend script)
Has anyone made this into a plugin, secure, tried and tested?
72dpi
04-10-2006, 12:24 AM
Hey Mondala,
If you can wait 2 weeks, HeavyEddie is going to help me release it.
It will have full admin capabilities, and spam prevention, such as Image verification.
I have my wedding comin up, so gotta prepare speech, get 2 jobs out etc.
Stay tuned mate, will be worth the wait!
Brent
04-11-2006, 01:03 PM
I'm sure it will be worth the wait, thanks to both of you for all your great work.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.