TomH Posted July 21, 2007 Share Posted July 21, 2007 Hi all, I have this script, nothing enteres the database. No errors either :S <?php include('connect.php'); $email = strip_tags(trim(stripslashes($_POST['email']))); $submit = $_POST['submit']; $query = "INSERT INTO newsletter (email) VALUES ('$email');"; if(isset($submit)){ function checkmail($email) { if(preg_match('/\A(?:[a-zA-Z0-9]!#$%&\'*+\/=?^_`{|}~-])+(?:\.[a-zA-Z0-9]!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-z0-9])?\.)+(?:[a-zA-Z]{2}|com|org|net\b)\Z/i',$email)) return true; } if(checkmail($email)) { mysql_query($query); }else{ mysql_close(); } } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.