title: php redirect on successful login
body: <p>I have a .php that registers a user by calling another php function but i dont know what the best way to redirect a user if the registration is successful. Is there an option other than header incase i want to echo something before i redirect?</p>
  
  <pre><code>&lt;?
  // processRegister.php
  //////////////////////
  
  // First include the class definition
  include('UserClass.php');
  
  // Next, create an instance of the class
  $newUser = new User;
  
  // Call the registerUser() method, passing in the required variables
  $newUser-&gt;registerUser($userName, $userPassword);
  
  // If it was an error, the class will kill the script, if not, it will reach this point
  $newUser-&gt;displayUserInfo();
  ?&gt; 
  </code></pre>