Jump to content

error with header()


scmeeker

Recommended Posts

I want to direct my user to a new page instead of printing a simple congratulations on the following page but when I try to use the header() function it give me a fatal error.

 

It likes this "echo"code and works fine:

 

$sql="INSERT INTO artist (username, password, email, terms, activationkey, status) VALUES ('$username', '$password', '$email', '$test_terms', '$activationKey', 'verify')";

if (!mysql_query($sql))

  {

  die('Error: ' . mysql_error());

  }  

echo "An email has been sent to $_POST[email] with an activation key. Please check your mail to complete registration.";

 

but it gives me the fatal error when I replace the "echo" statement with:

 

$sql="INSERT INTO artist (username, password, email, terms, activationkey, status) VALUES ('$username', '$password', '$email', '$test_terms', '$activationKey', 'verify')";

if (!mysql_query($sql))

  {

  die('Error: ' . mysql_error());

  }  

header("location:happy.php");

 

Any suggestions??  Thanks!

Link to comment
https://forums.phpfreaks.com/topic/206116-error-with-header/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.