mhgenterprises Posted May 15, 2007 Share Posted May 15, 2007 Hello, I can't see a problem in this script but I keep getting insert query failed errors. Here it is, let me know if you see anything wrong, certain items are marked with ****** for security reasons: <?php ############################ ## CONNECTION STRING ## ############################ include '*****connection info******'; $dbconnection = mysql_connect($dbhost,$dbuser,$dbpassword); $db = mysql_select_db($database,$dbconnection); $email = $_POST['email']; $email = substr($email, 0, 70); if(ereg("^[-_.A-Za-z0-9]+@([-_A-Za-z0-9]+\.)+([-_A-Za-z0-9]+)$",$email)) { $query = "INSERT INTO mailinglist (email) VALUES ('$email')"; mysql_query($query) or die('Error, insert query failed'); header("Location: http://www.nancygoldmanart.com/mailinglistsuccess.php"); return; } else { header("Location: http://www.nancygoldmanart.com/mailinglisterror.php"); } ?> Go to http://www.nancygoldmanart.com and type in an e-mail address and hit submit in order to see the error. Any help is greatly appreciated. This site launches in about 24 hours! Thanks! Link to comment https://forums.phpfreaks.com/topic/51429-insert-into-query-problem-help-please-site-launch-24hrs/ Share on other sites More sharing options...
bubblegum.anarchy Posted May 15, 2007 Share Posted May 15, 2007 Make the following code changes and post the results here: $query = "INSERT INTO mailinglist (email) VALUES ('$email')"; mysql_query($query) or die('Error, insert query failed: '.$query.' error: '.mysql_error()); Link to comment https://forums.phpfreaks.com/topic/51429-insert-into-query-problem-help-please-site-launch-24hrs/#findComment-253319 Share on other sites More sharing options...
lost tech Posted May 18, 2007 Share Posted May 18, 2007 I can't help, I just wanted to ask if this script returns a display or updates a Dbase? Link to comment https://forums.phpfreaks.com/topic/51429-insert-into-query-problem-help-please-site-launch-24hrs/#findComment-256126 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.