<?
/************* PHPRecommend v 1.0 ***************/
/************************************************/
/* written by A. Gianotto - 3/28/2000 */
/* To find out if this is the latest version */
/* of this script, email snipe@snipe.net, or */
/* visit http://www.snipe.net */
/************************************************/
/************************************************/
/* PHPRecommend may be used freely for private */
/* or commercial use. All I ask is that you */
/* don't include it in any collections without */
/* my permission. */
/************************************************/
/************************************************/
/* DESCRIPTION: */
/* PHP "Recommend this page to a friend" script */
/* */
/************************************************/
/************************************************/
/* INSTALLATION: */
/* There is no readme or install file with */
/* script, because it's so easy to install, */
/* you just have to follow the comments in the */
/* first part of the code */
/************************************************/
/************************************************/
// make this point to your header file. rename the file
// and the path to point to the correct file on your server
// If you do not use a header or footer file, simply replace
// the header and footer includes with the proper HTML code
// for your site
// Enter the website administrators email address here
$adminaddress = "you@your-site.com";
// Enter the company name or site name here
$sitename = "your-site.com";
// Enter the address of your website here
$siteaddress ="http://www.your-site.com";
// Unless you are changing the verbage of the printed message,
// there are no further configurations that need to be done
// past this point, except editing the path to your footer includes
// If you do not use header and footer files, you can just replace
// the include calls with your HTML, but be sure to close the PHP tags
// before and after the HTML, so you don't get parse errors.
IF ($action==""):
?>
<H3>Recommend this page to a friend!</H3>
<?
$referer = getenv("HTTP_REFERER");
print "<B>$referer</B><BR><BR>";
?>
To send the URL of this page and a brief message to a friend who might like it, just fill out the
form below.
<BR>
<BR><B>NOTE:</B> We only request your name and email address so that the person you
are recommending the page to knows that you wanted them to see it, and that it is not junk
mail.
<BR><FORM METHOD=POST ACTION="<? echo "$PHP_SELF"; ?>">
<? include("/usr/home/your-site.com/html/inc/footer.inc");
exit;
ELSEIF ($action="Send"):
mail("$femail","$yname went to $sitename and recommended you check this out","$yname
stopped by $sitename and thought you would find the following URL of interest:
$sitename
$adminaddress
$siteaddress","FROM:$yemail");
?>
<H3>Thank you!</H3>
Your recommendation has been sent!
<BR>
<BR>
<FONT SIZE="3"><B><A HREF="<? echo "$url"; ?>">GO BACK</A></B></FONT>
<BR>
<BR>
<?
ENDIF;
include("/usr/home/your-site.com/html/inc/footer.inc"); ?>
// end of script
*********************************************
Making it work on your page:
Just put a link to phprecommend.php3 (or whatever you name the above file), and the script
does the rest!
Nor Aishah Hamid wrote :421
I found this code is really useful for my PHP`s
knowledge.. As before this I`ve try to understand the
codes from other resources...
But this code example make me easy to understand the
coding and my program is perfectly finish..