Jump to content

Recommended Posts

Perhaps I need another set of eyes on this but after Inserting into the Table (which that works fine), its not going to the next page:

 

    header("location:finalize.php");

 

It's inserting the new user, then staying on a blank page and not moving on to "finalize.php."

 

Here is the code from the page:

 

<?php

session_start ();

 

?>

<?php

 

include('connect.php');

 

$username = mysql_real_escape_string($_POST[username]);

$first_name = mysql_real_escape_string($_POST[first_name]);

$last_name = mysql_real_escape_string($_POST[last_name]);

$password = mysql_real_escape_string($_POST[password]);

$membership = mysql_real_escape_string($_POST[membership]);

$level = mysql_real_escape_string($_POST[level]);

$terms = mysql_real_escape_string($_POST[terms]);

 

 

$sql2="INSERT INTO user (first_name, last_name, username, password, membership, level, terms, date) VALUES ('$first_name', '$last_name', '$username', '$password', '$membership', '$level', '$terms', CURDATE())"; 

 

if (!mysql_query($sql2))

 

  {

 

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

 

  }else {

    header("location:finalize.php");

}

 

 

?>

 

Link to comment
https://forums.phpfreaks.com/topic/231445-page-not-directing-to-new-page/
Share on other sites

Are you developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON so that php will report and display all the errors it finds? There would likely be an error that would indicate why the header() statement is not working.

When I tested it out on my home server, it works fine but is not working "live."  That's where its giving me problems. 

 

I have - ini_set('display_errors', 0);  at the top of the page but no errors show up.  Is there something else I should do to show the errors?

 

Thanks.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.