Here's my current code: $query = "INSERT INTO `table` (`email`,`timestamp`) values ('".mysql_real_escape_string($email)."','$date')"; $result = mysql_query($query) or die(header('Location: /index.php?err=dupe_email')); header('Location: /index.php?success=1');
It's a bit ugly (assumes any error = dupe email, as that's a unique field)
I have a very simple form where it just has a spot to put in an email, and a submit button.
When you submit, it adds the email to the db with a timestamp, and lets you know it was a success.
But how would I handle multiple emails? I would like to allow the user to put in a comma-delimited list of email addresses (e.g. firstname.lastname@example.org,email@example.com) And add them all at the same time.
I don't need it to give an individual status update per email (e.g. "firstname.lastname@example.org already exists") when it's multiple, I just need to add them to the database.