SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Apr 2001
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to: send article to a friend

    Hi,

    I'm currently working on a mysql/php website. Most pages are generated dynamically from the mysql database.

    How do I add the feature: "send this article to a friend" ?
    I don't want to send html mail - just regular text.

    I'm looking for a tutorial or example files to reference as I try to add this feature.

    Sitepoint's website offers this feature and I'd love to see a tutorial of how they added this feature as I think it would be directly relevant to my website.

    Thank you,

    Shawna

  2. #2
    What's HTML?
    Join Date
    May 2001
    Location
    San Diego, CA
    Posts
    1,701
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try something like this:

    $sql = "SELECT article, articleID FROM table WHERE articleID='$id'";
    $result = mysql_query($sql, $connection);
    while ($row = @mysql_fetch_array($result))
    {
    $article = $row["article"];
    }

    mail($friendemail, $subject, $article, "From: $senderemail");

    $id would be the ID number of the article you wanted to send. You could define the value through a query.
    Ryan Kuhle - A Proud Advisor - Got Questions? Just Ask!
    Get your website started for less than $20! Click Here


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •