Build a Newsletter System With PHP and MySQL: New Plus Tut
plus

Build a Newsletter System With PHP and MySQL: New Premium Tut

Today, we are going to be building a newsletter system using PHP with a MySQL background. The tutorial will cover building a system that allows for multiple newsletter lists and the sending of messages to specific lists. Join today!

Example
Example

Join Tuts Premium

For those unfamiliar, the family of TUTS sites runs a premium membership service called “Premium”. For $19 per month, you gain access to exclusive premium tutorials, screencasts, and freebies at nettuts+, psdtuts+, and vectortuts+! For the price of a pizza, you’ll learn from some of the best minds in the business. Join today!

  • Subscribe to the NETTUTS RSS Feed for more daily web development tuts and articles.


Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • flo

    Jenny : I had the same problem but now it works ! Alex send me the answer.

    In the “messages_edit.php” page, juste replace your code by this one and it will work :

    // Check for a POST
    if(isset($_POST['submitted'])) {
    $link = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or die(‘There was a problem connecting to the database.’);
    if($template[0]['columns'] == “1″) {
    $body = mysqli_real_escape_string($link, $_POST['body']);
    $sql = “UPDATE messages SET subject=’”.$_POST['subject'].”‘, leftcol=’$body’, template_id=”.$_POST['template'].” WHERE id=$id”;
    } else {
    $leftcol = mysqli_real_escape_string($link, $_POST['leftcol']);
    $rightcol = htmlentities($_POST['rightcol']);
    $sql = “UPDATE messages SET subject=’”.$_POST['subject'].”‘, leftcol=’$leftcol’, rightcol=’$rightcol’, template_id=”.$_POST['template'].” WHERE id=$id”;
    }
    $stmt = $link->query($sql) or die($link->error);
    $stmt->close;
    $_SESSION['success'] = “Edited message.”;
    header(‘Location: messages.php’);
    }

  • Celio

    Hi there!
    This is such a nice tut, really worth the $9 fee, but I’m having lots of problems trying to get it done. So far i am about to start on the step 7 – subscribers, however I can’t get the template preview working at all. When i click on binoculars icon it won’t preview the template like on the screencast.

    Help, please!!
    Thanks