Pedro Chagas
asked on
Redirect page after send variables in Ajax and PHP
Hi E's, I have two pages, index.php and ajax.php, and in index.php I send variables via Ajax to ajax.php to be processor, and I use this line of code to do that in js:
How I do this?
The best regards, JC
$.post("ajax_processar.php",{"redirect":\'1\'},function(data, textStatus, jqXHR){});
When ajax.php receive the variable "redirect" what the script have to do is redirect the page index.php to somenewpage.php:
if($_POST["redirect"] == 1){
//redirect index.php to somenewpage.php ???????????
}
The solution can be in js also.How I do this?
The best regards, JC
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I know redirect page in the same page, but in my particular case I need that redirect come from the page of Ajax.php and don't from index.php.
In practice what I want to do is check some error that occurs in ajax.php, and I detect the errors if the page is redirect, like somenewpage.php?zone=1, somenewpage.php?zone=2, somenewpage.php?zone=3 and so on...
For you understand, Ajax.Php receive lots of variables from index.Php via ajax, and Ajax.php will process that variables with a lot of conditionals, and something wrong happens, because the script no respond always in the same way, and I need to know in what zone of the script the error occurs.
That is the reason I need to redirect the page and the order have to come from Ajax.Php and not from index.Php.
Have a solution?
The best regards, JC