Posted By

daveismyname on 09/27/09


Tagged

function redirct


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

vali29
gecube


Redirect page with a simple function


 / Published in: PHP
 

very useful function that allows you to redirect to the user to a given location

  1. function redirect($location) {
  2. if ($location !=NULL) {
  3. header("Location: {$location}");
  4.  
  5. } // End of above if statment.
  6.  
  7. } // End of function.
  8.  
  9. //usage example
  10. $location = 'sample.php';
  11. redirect($location);

Report this snippet  

You need to login to post a comment.