[thelist] "email to a friend" link

Howard Cheng howcheng at ix.netcom.com
Wed Sep 11 14:20:01 CDT 2002


It's very easy. You just pass the URL in the query string of your referring
page (encoded) and use it in the mail message. If PHP:

<?
if ($submit) {
     $msg = "<html><head></head><body>"
           ."blah blah blah blah blah blah"
           ."<br><br>$url"
           ."</body></html>";
     $headers = "From: foo at bar.com\r\n"
               ."Content-Type: text/html; charset=iso-8859-1\r\n";
     mail($to, $subj, $msg, $headers);
     $screen = "thanks";
}
else $screen = "form";
?>
<html>
<body>
<? if ($screen=="form") { ?>

<form action="<?= $PHP_SELF ?>" method="post">
[inputs for to, from, message]
</form>

<? } else { ?>

<p>your email has been sent.</p>

<? } ?>
</body>
</html>

At 03:04 PM 9/11/2002 -0400, Matt S. wrote:
>Can anyone recommend a good way to do this? when clicked, it would take them
>to a new screen, where they would fill in the recipients email, their
>own name and email, and a brief message, and it would send all this plus
>the URL for the page they came from to the recipient. Basically, its
>your standard" email to a friend" feature, like you find on any news
>site. I wouldn't want to grab the contents of the page, just the URL,
>and the email it created would be a simple HTML email, containing some
>simple branding (logo in the corner).

::::::::::::::::::::::::::::::::::
Howard Cheng
http://www.howcheng.com/ <-- NEW!
howcheng at ix dot netcom dot com
AIM: bennyphoebe
ICQ: 47319315




More information about the thelist mailing list