<?php
if(isset($_POST['mail'])) {
mysql_connect('<YOUR HOST>', '<YOUR DB-USER>', '<YOUR DB-PASS>') or die ('Connection Error');
mysql_select_db('<YOUR DB-NAME') or die ('Couldnt select DB');
$mail = mysql_escape_string($_POST['mail']);
$query = "INSERT INTO mail (id, mail) VALUES (NULL, '$mail')";
mysql_query($query);
header('Location: <YOUR THANK-YOU-PAGE>.php');
} else {
echo '<p>Please insert your email.</p>';
}
?>
<form action="" method="post" name="formular">
<fieldset><label>Enter Mail</label><input type="text" maxlength="25" name="mail" value="" /></fieldset>
<input type="submit" name="send" value="Submit email" />
</form>
Thanks Buddha. I'm grateful for your time.