radalin Posted September 11, 2006 Share Posted September 11, 2006 Is there a way to pause the working of a script and then wait something from user and then continue to work?It does not look possible thought. Well that's for submitting a form. Like this one you send a post. While sending it checks if you are logged in or not. If you are it submits the post. But if you're not wait for user to login and then continue to post.Or should I keep the post datas on hidden values then check for the user's login and then redirect the user to the form page filled from hidden input fields and then ask the user to resubmit it?Any other ways are welcome too. Link to comment https://forums.phpfreaks.com/topic/20378-pause-the-php-script/ Share on other sites More sharing options...
Wintergreen Posted September 11, 2006 Share Posted September 11, 2006 I'm not sure how long $_POST variables live, but if you're using sessions you could do a check on the form processing page that sees if the user is logged in, and if they're not, put the form data the wrote into some session variables and use them for the value in the original form. You can do a quick check for the form that sees if there is any user data stored in variables, likeecho "<input name=blah type = text";if(isset($_SESSION['title'])) { echo " value=" . $_SESSION['title'];}echo ">";So if you put something along those lines in the original form, if they try to submit something without logging in you can send them somewhere to have them login and still have the stuff they wrote stored in variables. Link to comment https://forums.phpfreaks.com/topic/20378-pause-the-php-script/#findComment-89740 Share on other sites More sharing options...
Jenk Posted September 11, 2006 Share Posted September 11, 2006 In a technical sense, no. Asynchronous requests are not possible with php. JavaScript's XMLHttpRequest offers a work around, but even that technically is not Asynchronous, despite it having that buzzword associated with it. Link to comment https://forums.phpfreaks.com/topic/20378-pause-the-php-script/#findComment-89806 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.