Actually, this is pretty easy. I use MySQL. What I did was to pass the ArticleID to the email to friend page and put it as a hidden tag in my form.
when they click on http://something.com/email.php?id=6 , number "6" is passed as the id:
<FORM ACTION="<?php echo($PHP_SELF); ?>" METHOD=POST>
<P>Email this Article to a Friend:<BR>
<P>Article URL:
<?php echo(" <INPUT TYPE=HIDDEN NAME=articleid VALUE=$id>"); ?>
<P>Your Name: <INPUT TYPE=TEXT NAME="sendername" SIZE=20><BR>
Your Email: <INPUT TYPE=TEXT NAME="senderemail" SIZE=20><BR>
Your Friend's Name: <INPUT TYPE=TEXT NAME="recipientname" SIZE=20><BR>
Your Friend's Email: <INPUT TYPE=TEXT NAME="recipientemail" SIZE=20><BR>
Message to your friend: <INPUT TYPE=TEXT NAME="message" SIZE=20><BR>
<INPUT TYPE=SUBMIT NAME="submit" VALUE="SUBMIT"></P>
</FORM>
When the form is submitted, it will fetch the relevant data from the MySQL database based on the ArticleID that is being passed:
<?php
if ($submit):
fetch all details based on ID=$articleid
?>
And, then after that, just send the email using the mail function. Put in the message "This page can be found at $baseurl/article.php?id=$articleid."
This message only sends out the URL of the article. However, if you want to send out the whole content of the page, you need to fetch the content from the database.
Hope this helps.
Laura Brandt
--
Aletia Hosting - Full-Featured, Superfast Web Hosting
PHP, MySQL, Perl, Multiple domain support and more.
200MB + 10GB Transfer at $9.95/mth
http://AletiaHosting.com - AIM: AletiaSales