Problem with header("Location:" )...

From: Date: Sun, 31 Jul 2011 18:40:15 +0000
Subject: Problem with header("Location:" )...
Groups: php.general 
Request: Send a blank email to php-general+get-314253@lists.php.net to get a copy of this message
So I'm attempting to redirect back to the main site of a page after a successful insert into a database... Here's my code: <?PHP if (!$resp->is_valid) { // What happens when the CAPTCHA was entered incorrectly die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")"); } else { $name = mysql_real_escape_string($_POST['txtName']); $comment = mysql_real_escape_string($_POST['areaComment']); $phonelink = mysql_real_escape_string($_POST['phonelink']); $SQL = "INSERT INTO comments (name, comment, phonelink) VALUES ('$name', '$comment', '$phonelink')"; mysql_query($SQL) or die("Unable to insert at this time. Sorry for the inconvience"); //echo "Insert successful!"; header("Location: HTTP://jason.pruimphotography.com/dev/clients/flewid/Phone/"); // Your code here to handle a successful verification } ?> The insert happens, BUT it won't redirect back to the site.... There isn't any reason I should be able to do a header() redirect at that point is there? Or is there a better way to do it? Thanks Everyone! Jason Pruim lists@pruimphotography.com

« previous php.general (#314253) next »