/ Published in: PHP

Redirect page using PHP function.
I don't like using header() as I like to redirect page mid-page. This is implemented using Javascript written through PHP function. Has a die() function at the end for people who has disabled their Javascript in their browser.
I don't like using header() as I like to redirect page mid-page. This is implemented using Javascript written through PHP function. Has a die() function at the end for people who has disabled their Javascript in their browser.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function redirect($new_location){ echo ("<script type='text/javascript'> document.location.replace('$new_location'); </script> "); }
Comments
