Script: php Site Recommender
Property: © Big Lick Media - BigLickMedia.com
Author: D Stewart
[You will need]:
1. A PHP enabled host
Easy to install and configure
Will allow your visitors to recommend your site to as many recipients as you specify (only one required).
Default messages are easily modified.
Look and feel is customizable via the stylesheet.
You can choose to be notified when your site has been recommended.
Notification will show recipient(s) AND the message!
Contains error checking and validation.
1. Edit/rename any of the three web files as needed (make certain you edit the "config" section in "inc.recommend.php").
2. Reference inc.recommend.php as an include. ie.
3. Modify/use the included stylesheet (recommend.css) or merge into your existing styles.
4. Upload files to host (no chmod necessary).
5. That's it!
recommend.php is not mandatory. It is included in the zip file to demonstrate how to include inc.recommend.php in your page(s). Think of recommend.php as the page in which you want to include the script. Simply place:
in any .php file.
If you would like your visitors to recommend the current page they are on instead of the entire site, you can use http_referer. Here are the steps:
1. Add $referrer = $_SERVER['HTTP_REFERER'];
to the config section anywhere ABOVE the first instance of $emailmessage
$emailmessage = "Hello,\n\r[name] thought you would like to visit the following site: [url]";
$emailmessage = "Hello,\n\r[name] thought you would like to visit the following page: $referrer";
1: Cut and paste the below script into the <head> section of your page:
- <?php include("inc.recommend.php"); ?>
Please rate us!
var formerrormsg="You\'ve attempted to submit the form multiple times.\n Please reload page if you need to resubmit form."
if (typeof formerrormsg!="undefined")
2: With the script installed, all that remains is to add an onClick attribute:
<input type="submit" value="Submit" onClick="return checksubmit(this)">