![]() |
Submit to function without refresh or leaving page - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Submit to function without refresh or leaving page (/showthread.php?tid=59572) |
Submit to function without refresh or leaving page - El Forum - 10-22-2013 [eluser]Unknown[/eluser] Hi, I was wondering what the best way to do this would be. I have got a function that takes about an hour to run and so would not want the user sitting on the window for an hour. I am using: Code: ignore_user_abort(true); To make sure the script runs without the user, however ideally I am wanting to run the function away from the browser, so on the forms post I can display a screen to say "We will email your results" without the page stuck on loading using something like flush. The form submit happens inside my controller: Code: $this->form_validation->set_rules('keyword', 'Keyword', 'required'); Now this all works fine, but again it will refresh the page and leave it loading a good hour, what would be the best way to load a clean page instantly while the form is still being submitted? Thanks, Simon Submit to function without refresh or leaving page - El Forum - 10-22-2013 [eluser]CroNiX[/eluser] Make an asynchronous request. http://blog.markturansky.com/archives/205 |