Re: [PHP] php/ajax question

2007-01-02 Thread Richard Lynch
Mixing Location and Cookie headers has always been hit and miss... I think you could fix it with session_write_close() or you could just replace the Location: with: require 'b.php'; since you are just wasting HTTP connections the way you have it now... On Sat, December 30, 2006 12:56 pm, tedd

[PHP] php/ajax question

2006-12-30 Thread tedd
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;?

Re: [PHP] php/ajax question

2006-12-30 Thread Mark Kelly
On Saturday 30 December 2006 18:56, tedd wrote: Why can't the php script redirect the browser when called via ajax ? The browser will not be expecting a page back, and will ignore headers. Just some quick suggestion code, this isn't tested (except createRequest - I use that all the time)...

Re: [PHP] php/ajax question

2006-12-30 Thread Paul Novitski
At 12/30/2006 10:56 AM, tedd wrote: Why can't the php script redirect the browser when called via ajax ? Ajax is giving PHP control over just that byte-stream that ajax is receiving and perhaps inserting into the page, not the full page itself. Say you use javascript to set the src of an

Re: [PHP] php/ajax question

2006-12-30 Thread tedd
At 12:55 PM -0800 12/30/06, Paul Novitski wrote: At 12/30/2006 10:56 AM, tedd wrote: Why can't the php script redirect the browser when called via ajax ? Ajax is giving PHP control over just that byte-stream that ajax is receiving and perhaps inserting into the page, not the full page

Re: [PHP] php/ajax question

2006-12-30 Thread Mark Kelly
On Saturday 30 December 2006 18:56, tedd wrote: Why can't the php script redirect the browser when called via ajax ? The browser will not be expecting a page back, and will ignore headers. The response must be handled by a function you define. For the sake of a quick demo, if your php accepts