A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: 2 things I am looking for.

  1. #1
    The G5 SP N_R_D's Avatar
    Join Date
    Apr 2004
    Posts
    1,118

    2 things I am looking for.

    I was wondering if yall already have, or know of a place with a really good tute on....

    1) A way to have a MySQL data base be able to send out an email to a group of email addresses.....

    2) A way for flash to upload to PHP that writes the name and email address to a MySQL database sot hat it may be use as number one states



    Really...I just want a mailing list that can do everything itself.

    I dont want to have to input email adresses and names by hand.



    If there is a good resource for this type of thing that would be great !

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    item 1) is not trivial: some hosts may impose limits on the number of mails you send, so a mail list application may have to take care of that.
    For some time I was running one where I would upload the mail message to the server. The script would send the first 100 mails and then restart itself via a browser reload with an extra delay, to send the next lot of 100
    item 2) could be as simple as adding the email to a mysql database. However, I would suggest to use confirmed opt-in: if user entere email, a random key is generated, saved to the database along with the email, and mailed to the new subscriber. The subscriber would visit a website (with the key appended to the url, or enter the key into a web form) to ccomplete subscription

    Musicman

    Musicman

  3. #3
    The G5 SP N_R_D's Avatar
    Join Date
    Apr 2004
    Posts
    1,118
    That sounds good...how would i go about doing that?

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    just a few random bits and pieces
    database layout:
    email varchar(64) unique,
    code char(32), -- depends on coding
    applied timestamp,
    confirmed timestamp

    php to add a new subscriber
    Code:
    <?
    include "connect.php";
    $email = $_POST['email'];
    $res = mysql_query("select * from subscriptions where email = '$email'");
    if(mysql_num_rows($res))
    {  if(mysql_result($res, 0, "confirmed") != "")
          print "&status=confirmed";
       else
       {   print "&status=applied";
           sendmail($email, mysql_result($res, 0, "code"));
        }
    }
    else
    {   $code = md5(time() . $email);
        mysql_query("insert into subscriptions (email, code, applied) values ('$email', '$code', now())");
        sendmail($email, $code);
        print "&status=new";
    }
    function sendmail($email, $code)
    {   mail($email, "subscription", "please visit http://www.yourserver.com/newsletterconfirm.php?code=$code");
    }
    ?>
    php to accept subscription
    Code:
    <?
    include "connect.php";
    $code = $_GET["code"];
    $res = mysql_query("select * from subscriptions where code = '$code'");
    if(!mysql_num_rows($res))
       die("sorry, not in database");
    else if(mysql_result($res, 0, "applied"))
       die("subscription already completed - we are just lazy on sending newsletters");
    else
    {   mysql_query("update subscription set applied = now() where code = '$code'");
        print "subscription confirmed - we will send newsletters to " . mysql_result($res, 0, "email");
    }
    Musicman

  5. #5
    The G5 SP N_R_D's Avatar
    Join Date
    Apr 2004
    Posts
    1,118
    Wow...

    I am going to need a little more help I gues

    WOuld it possible to kick it down to a newbies level for me?

    Fairly new with PHP and MySQL interaction

    THanks MusicMan

  6. #6
    d e s i g n dhchin's Avatar
    Join Date
    Jan 2003
    Location
    Midwest
    Posts
    139
    N_R_D

    I love your favicon. Please explain!

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center