Page 2 of 2

Re: AJAX / PHP header("Location: http://new-url.php");

Posted: Fri Nov 19, 2010 2:03 pm
by Designer
I think the solution to this is a bit more involved than meets the eye!

It is one of those jobs you think is only going to take about an hour and so far I have spent two days on it! :oops:

I think the code I have posted to date is flawed is several areas and is not a clean as I would like it to be. Sometimes it is best just to go back to the drawing board.

I noticed there is a forum for people whom like a challenge, so I could also try there.

Using JQuery might simplify the task, but again I'm not an expert at this.

When I find or am told the solution I'll let you all know!

Re: AJAX / PHP header("Location: http://new-url.php");

Posted: Fri Nov 19, 2010 2:27 pm
by Neilos
We're never experts in the beginning. Or in my case, the middle and the end too.

What is it you're trying to achieve anyway?

Re: AJAX / PHP header("Location: http://new-url.php");

Posted: Fri Nov 19, 2010 2:46 pm
by Designer
What I'm trying to achieve is quite simple at face value.

Use Ajax to validate a form and once valid, pass control to the next screen. It is the passing control that is causing the problem. :banghead:

Re: AJAX / PHP header("Location: http://new-url.php");

Posted: Sat Nov 20, 2010 9:51 am
by Designer
There's some good news & bad news so far.

The good news, if you can call it that, the route of 'header (Location: 'new-url'); is not possible when using AJAX.

However, there is a way round this problem, but the redirect need to be done using javascript window.location='new.url'; and this redirect is done upon successful completion of Ajax validation, both client and server-side.

All I need to do now is get the Ajax code working!

Any experts on Ajax? :?: