Jump to content


pause the php script

  • Please log in to reply
2 replies to this topic

#1 radalin

  • Members
  • PipPipPip
  • Advanced Member
  • 179 posts

Posted 11 September 2006 - 12:01 PM

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.
Roy Simkes
Yet Another Parkyeri Developer

#2 Wintergreen

  • Members
  • PipPipPip
  • Advanced Member
  • 107 posts

Posted 11 September 2006 - 12:08 PM

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, like
echo "<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. 

#3 Jenk

  • Members
  • PipPipPip
  • Advanced Member
  • 778 posts

Posted 11 September 2006 - 02:20 PM

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.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users