|
Posted by Rik on 05/28/06 21:23
mherman3@gmail.com wrote:
> I have a page that sends a request to another PHP page on my site.
> If I try and set the header in the page that is being called, with
> header(Location: ...), the site doesn't get redirected like I'd like
> it to, it just writes a response to the original page. The response
> that it writes is the HTML of the page that I'd like the site to be
> redirected to.
> Is there a way that I can redirect from the script that is being
> called through an xmlRequest?
This is logical, and has more to do with javascript then PHP:
1. You make a request using js.
2. Requested page is a PHP-script.
3. PHP-script answers that requests should be redirected to other page.
4. javascript requests the page where it is redirected to, as it should, and
prints it on the current page.
If there is a possibility you get content, and not just redirects, from the
PHP page, ask in a javascript group how to achieve this.
If the request is dependant on other javascript actions, ask in a javascript
group how to achieve this.
If the script in questions only redirects, and the request isn't dependant
on other js actions/functions: don't use javascript, just link to the
script.
Grtz,
--
Rik Wasmus
[Back to original message]
|