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(); } } ?> Link to comment https://forums.phpfreaks.com/topic/61092-little-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.