My questions is about redirection from PHP. I know that we can redirect from a php page to another page by nust using
header("Location: ".$redirectURL);
In my case, one php file receives a XMLHttp POST request, done using javascript in front-end. It manipulates some data in it, and now sets a cookie and then i want to redirect to another page. All pages are in same domain only.
I want to move to the other page, from PHP. Can i do this? Any methods for these?
edit:
Situation is like this, from a login page, i will post the username &password to one php page, where its validated. From validation its understood if the user belongs to a server in some other region(We use a regional divisioning), i will redirect him to that servers login page, but with a cookie set. So that login page understands he’s already logged in, and open his homepage.
Thanks for Help 🙂
client : ajax client which do request
serverphp : php file which executing ajax request
1. Redirect client to another page
serverphpreturn an addressclientlistener redirect client’s browser2. Redirect serverphp to another page
You can do a request to
first.phpthen redirect it tosecond.phpand ajax will get answer fromsecond.php