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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.