|
-
The G5 SP
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 !
-
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
-
The G5 SP
That sounds good...how would i go about doing that?
-
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
-
The G5 SP
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
-
d e s i g n
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|