|
|
|
<?
/************* 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
include("/usr/home/your-site.com/html/inc/header.inc");
// 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"; ?>">
<TABLE BORDER="0" CELLSPACING="3" CELLPADDING="3">
<TR>
<TD VALIGN="TOP"><FONT FACE="Arial, Helvetica, Verdana, Sans Serif" SIZE="-
1">Your Name:</FONT></TD>
<TD VALIGN="TOP"><FONT FACE="Arial, Helvetica, Verdana, Sans Serif"
SIZE="3"><INPUT TYPE="text" NAME="yname"></FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP"><FONT FACE="Arial, Helvetica, Verdana, Sans Serif" SIZE="-
1">Your Email:</FONT></TD>
<TD VALIGN="TOP"><FONT FACE="Arial, Helvetica, Verdana, Sans Serif"
SIZE="3"><INPUT TYPE="text" NAME="yemail"></FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP"><FONT FACE="Arial, Helvetica, Verdana, Sans Serif" SIZE="-
1">Friend's Name:</FONT></TD>
<TD VALIGN="TOP"><FONT FACE="Arial, Helvetica, Verdana, Sans Serif"
SIZE="3"><INPUT TYPE="text" NAME="fname"></FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP"><FONT FACE="Arial, Helvetica, Verdana, Sans Serif" SIZE="-
1">Friend's Email:</FONT></TD>
<TD VALIGN="TOP"><FONT FACE="Arial, Helvetica, Verdana, Sans Serif"
SIZE="3"><INPUT TYPE="text" NAME="femail"></FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP" COLSPAN="2"><FONT FACE="Arial, Helvetica, Verdana, Sans
Serif" SIZE="-1">Additional Comments:</FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP" COLSPAN="2"><FONT FACE="Arial, Helvetica, Verdana, Sans
Serif" SIZE="3"><TEXTAREA NAME="comments" ROWS="3"
COLS="30"></TEXTAREA></FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP" COLSPAN="2"><FONT FACE="Arial, Helvetica, Verdana, Sans
Serif" SIZE="3"><INPUT TYPE="hidden" NAME="url" VALUE="<? echo "$referer"; ?>"><INPUT
TYPE="submit" NAME="action" VALUE="Send"></FONT></TD>
</TR>
</TABLE>
</FORM>
<BR>
<BR>
<BR>
<BR>
<BR>
<? 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:
URL: $url
Additional Comments:
------------------------------------
$comments
------------------------------------
Thank you!
$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!
|
|
| PHPLinkRot v1.0 - program which allows users to report broken links on
your website just by clicking a button. Works well on custom 404 pages Categories : PHP, Complete Programs, Debugging, URLs, Site Planning | | | phpHoo2 (Xhoo using php3/MySQL) is a Yahoo-like link directory. Much like the Open Directory Project (dmoz.org). Categories : PHP, Complete Programs, Directories, MySQL, URLs | | | A PHP based webmail at : http://www.horde.org/imp Categories : Email, IMAP, PHP, Complete Programs | | | AITSH Mail Categories : Complete Programs, Email, PHP | | | An email validation script that actually checks against the recipient's mail server. Categories : Email, Complete Programs, PHP, Network, Debugging | | | PHP port of Matt Wrights FormMail.pl WWW form to e-mail gateway. Categories : Email, Complete Programs, Environment Variables, PHP | | | phpRecommend v1.2 - UPDATED - recommend this page to a friend
script - VERY easy install - now with data logging to text file Categories : Complete Programs, PHP, Link to Article, URLs, Misc | | | phpEasyMail: An easy way to send data from HTML-forms via EMail. Categories : Email, HTML and PHP, Complete Programs, PHP | | | Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs. Categories : Databases, PHP, MySQL, Complete Programs | | | phpAds, a complete banner and ad management system with detailled tracking and stats. Categories : MySQL, Complete Programs, Ecommerce, PHP, Databases | | | Point and Click Interface ala MS Access for creating SQL statements. Categories : MySQL, Complete Programs, General SQL, PHP, Databases | | | Searches through a local INN server's discussions Categories : Search, Complete Programs, PHP | | | phpCards - PHP/mySQL postcard script with web based admin to add, edit, and delete cards and categories. Very easy to install. Categories : PHP, Complete Programs, HTML and PHP, MySQL | | | Expose - PHP template engine, supports server and client-sided caching,a plugin system, multiple languages, template script language is based on PHP itself. Categories : PHP, PHP Classes, Templates, Complete Programs | | | Parses HTTP_USER_AGENT so that you can customize your site to different browsers Categories : HTML, PHP, Complete Programs | |
| | | | 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..
| |
|
|
|