Hey all!
I have created a little newsletter for my website, but I seem to have run into a little bit of problems. I have this little form:
<form action="<?= $PHP_SELF ?>" method="post">
<input type="text" name="nl_email2" size="30" class="form2" value="<? echo $nl_email2 ?>">
<input type="submit" value="Unsubscribe">
</form>
But I want PHP to check a few things before submitting. When I click the submit button it should both check if the e-mail address is valid, but it should also check if the e-mail address really IS in my database - for some reason I have a bit of difficulty with that.
One little thing about it is that I will not delete e-mail addresses that are located in the database but haven't been confirmed yet (when they subscribe they get a confirmation mail - if it isn't confirmed it should give them an error saying "e-mail isn't confirmed yet" or something like that)
Normally I do something like this in the top of the document:
if($_SERVER['REQUEST_METHOD']=="POST")
{
$nl_email2 = isset($_POST["nl_email2"]) ? $_POST["nl_email2"] : "";
... and then start testing but it doesn't work now.
Anyone have any idea how to do this?