Handy (shortcut) function for reloading, redirecting a page. I used is mainly to prevent the browser asking if the user wants to resend the data, when he is on a posted page.
<? function restart( $url = false ) { if( $url == false ) { $url = explode( '?', $_SERVER['REQUEST_URI'] ); header( 'location: ' . $url[0] ); } else { header( 'location: ' . $url ); } // no code needs to be run after calling this function. die(); } ?>
...
Comments
Add your comment