hi
I have problem with AJAX and php.
In .htm file: I load content of a .php file into my layer (<div ...).
the major my script of .php file is:
header("Locatoion: /search.php");
i want .htm file is redirect to /search.php .
But /search.php is load into layer and .htm doesn't redirect.
Can u help me.
thanks
PHP and AJAX problem
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
When you load a PHP script via XMLHttpRequest, it's a separate request from that of the page making the AJAX request. You'll need to handle the redirect with Javascript using
Code: Select all
location.href="http://mysite.com/page.htm";RE: aaronhall
thank u Kieran Huggins but aaronhall:
I added this line to .php file:
This script load in my layer (<div ...) but .htm file should be refresh to run this script.
Can I use a method to running this script when .php is load?
I added this line to .php file:
Code: Select all
echo '<script language="javascript">location.href="/search.php";</script>';Can I use a method to running this script when .php is load?
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact: