Try lowercase 'http'. Anything in error log? Try turning on display_errors.



-----Original Message-----
From: Jason Pruim [] 
Sent: Sunday, July 31, 2011 8:40 PM
To: <>
Subject: [PHP] Problem with header("Location:" )...

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:

  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
      //echo "Insert successful!";

      // 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

Or is there a better way to do it?

Thanks Everyone!

Jason Pruim

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to