This question already has an answer here:
- How to make a redirect in PHP? 28 answers
Can PHP make a redirect call after executing a function? I am creating a function on the completion of which I want it to redirect to a file located in the same root folder. Can it be done?
if {
//i am using echo here
}
else if ($_SESSION['qnum'] > 10) {
session_destroy();
echo "Some error occured.";
//redirect to user.php
}
You can use this code to redirect in php
The header() function does this:
Simple way is to use: