How Do I Make a Redirect in Php?
Is It Possible to Redirect a User to a Different Page Through the Use of Php? Say the User Goes to and I Want to Redirect Them To, How Would I Do So Without...
Is it possible to redirect a user to a different page through the use of PHP?
Say the user goes to and I want to redirect them to , how would I do so without the use of a meta refresh? Is it possible?
This could even protect my pages from unauthorized users.
33 Answers
Summary of existing answers plus my own two cents:
Must Read
1. Basic answer
You can use the header() function to send a new HTTP header, but this must be sent to the browser before any HTML or text (so before the <!DOCTYPE ...> declaration, for example).
header('Location: '.$newURL);