Jump to content

...after php executes just to a link?


xcali

Recommended Posts

Hi guys being a noob i posted this in the wrong section before so here i go again >_<

 

After my php code executes and everything is successful i would like it to jump to a different page.

Is there an easy way to do it?

for example

:

}

...SOME CODE HERE THAT VERIFIES EVERYTHING

// If everything's okay.

  // Register the user in the database.

      require_once ('dbconnect.php'); // Connect to the db.

  // Make the query.

      $query = "INSERT INTO users (first_name, last_name, email, password, regis_as) VALUES ('$fn', '$ln', '$e', SHA('$p'), '$r' )";     

      $result = @mysql_query ($query); // Run the query.

if ($result) { // If it ran OK.

GO TO SOME LINK ?

        exit();

GO TO SOME LINK ?

 

      } else { // If it did not run OK.

        echo '<h1 id="mainhead">System Error</h1>

        <p class="error">You could not be registered due to a system error. We apologize for any inconvenience.</p>'; // Public message.

        echo '<p>' . mysql_error() . '

 

Query: ' . $query . '</p>'; // Debugging message.

        exit();

      }

      mysql_close(); // Close the database connection.

  } else { // Report the errors.

      echo '<h1 id="mainhead">Error!</h1>

      <p class="error">The following error(s) occurred:

';

      foreach ($errors as $msg) { // Print each error.

        echo " - $msg

\n";

      }

      echo '</p><p>Please try again.</p>

 

so basically after it verified everything, added the user to a database i would like it to jump to a signupC.html (signup complete)

would i put the code before exit(); or after? (its not a header or footer its a new site) or all the way down after the code :(

 

Please advise

 

Thank you

Link to comment
Share on other sites

hmmm

for some reason it doesn't want to display the page - it does run through the query flawlessly - adds a user and all the info and then i just get a blank page (doesn't even switch to  header('../signupC.html');

 

any idea what could be wrong?

...

if ($result) { // If it ran OK.

header('../signupC.html');

exit();

...

Link to comment
Share on other sites

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.