I have a page that allows for used input, when the user inputs his/her specifications and selects submit the algorithm will run. This can take a few minutes depending on input. The user will also be directed to a page which will show their results. I want to show a block of php code that allows for the user to input their email and an email containing the url for results will be sent to them automatically when the results are ready. However, if the results are ready I want the block of code (acting like loading page) to ‘disappear’ and the results visualisation code to run.i.e. show the results. is this possible? I’m fairly new to programming, so not sure the way to go about this. Thanks for the help.
Share
The thing about PHP script is that, it will keep running until –
1) The server kills the script.
2) Script kills itself.
So whatever you are doing, it will keep running in the PHP script untill it is finished and t the end you could place the algorithm to mail the user. To have the results placed back when they are ready you could use Ajax. You could see the following tutorial for Ajax with jQuery: http://www.devirtuoso.com/2009/07/beginners-guide-to-using-ajax-with-jquery/