pass info after ajax submission

Hello, i think this a question with ajax javascript and php..

i’m going crazy trying to figure this out if anyone can help me i would really appreciate it…

here is the scenario i have confirm.php with the form. on submit button it calls a reserve.php page via ajax.. on confirm page after the submission of the form and after the reserve page is called i have this code

setTimeout("window.location.href=’logistica_list.p hp’",10000);

when the user submits the form it redirects to a new page after 10 second of form submitted, this works fine. the problem is that sometimes after submitting the form the user may have error in that case i need the page not to do the redirection. so i tried this on reserve.php

if(!$errors){
echo "<b>RESERVATION HAS BEEN ADDED TO THE CALENDAR</b>";
echo ‘<script> var submitted = "OK"; </script>’;
}

and then on the confirm.php i tried to get the variable submitted

if(submitted == "OK"){
setTimeout("window.location.href=’logistica_list.p hp’",10000);
}

but it doesnt work i dont really know ajax and just a little of javascript, so i dont know if this is even possible.

thanks inadvance and any help will be greatly appreciate it

View full post on Tycoon Talk

Author: eWebmaster.us on December 28, 2011
Category: SEO & Internet Marketing
Tags: , , , ,

Leave a Reply

Last articles

Get Adobe Flash player

Powered by Yahoo! Answers

SEO Powered by Platinum SEO from Techblissonline

© 1992-2012 DC2NET™, Inc. All Rights Reserved