php/ajax question
- From: tedd@xxxxxxxxxxxx (tedd)
- Date: Sat, 30 Dec 2006 13:56:22 -0500
Hi gang:
I have a small php script that behaves differently depending upon who's calling it. The code is:
<?php session_start(); /* a.php */
ob_start();
$_SESSION['var'] = "test";
ob_clean();
header("Location: http://www.example.com/b.php"); /* Redirect browser */
exit; ?>
If the code is called directly, namely http://www.example.com/a.php, then the $_SESSION var is filled with "text" and the redirect is realized.
However, if the php script is called via ajax:
-snip- preceding ajax
function sndReq(action)
{
http.open('get', 'a.php');
http.send(null);
}
Then the $_SESSION var is filled with "test", but the redirect is not realized.
Why can't the php script redirect the browser when called via ajax ?
Thanks.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
.
- Follow-Ups:
- Re: [PHP] php/ajax question
- From: Mark Kelly
- Re: [PHP] php/ajax question
- From: Paul Novitski
- Re: [PHP] php/ajax question
- From: Mark Kelly
- Re: [PHP] php/ajax question
- Prev by Date: Re: help with \n\r in strings
- Next by Date: Re: [PHP] php/ajax question
- Previous by thread: retrieve top n entries from an associative array
- Next by thread: Re: [PHP] php/ajax question
- Index(es):
Relevant Pages
|