- Want to redirect a page using PHP code? Use this line of codes;
header(’Location: THE-URL’);
- I would not recommend a heavy usage of it. It’s a bad practice especially if you’re validating data from the previous page. It’s not that it can’t be used for data processing, but I would not recommend it when passing sensitive informations. Why? Please refer to the GET and POST tutorial ;)
- Take note of this: If you want to use this method to redirect, make sure this code is called/placed first thing before any other actual outputs is sent. Or you will get this kind of errors;
Cannot modify header information – headers already sent by… blaa… blaa…
- This is because any calls affecting HTTP header will not work if output has already been written to the browser.

ajwa . Naj . Wawa . 26 . 











