Re: [PHP] Pause for user input?
In CLI you can use readline See the readline section in the PHP manual at http://www.php.net/manual/en Jason On Wed, 2002-11-20 at 06:42, Larry Brown wrote: > Does anyone know of a method to pause during the processing of a script to > prompt a user for information and then incorporate the user's response for > the remainder of the script? > > Larry S. Brown > Dimension Networks, Inc. > (727) 723-8388 > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Pause for user input?
I understand that the Javascript will not pause the page from loading; however, it should, like you stated, modify the page and hence change what the client is seeing interactively which could include hiding/revealing different questions based on their input. This should ultimately present a form with answers to those customized questions without traversing a number of pages. I only asked the question hoping there was a method of accomplishing this that I wasn't aware of in PHP. It is understandable that it would not be possible server-side, but I figured I would check with the gurus. Thanks, Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: @ Edwin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 2:39 PM To: Larry Brown Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Pause for user input? "Larry Brown" <[EMAIL PROTECTED]> wrote: > The idea is to have the script start to load, prompt for a question or more, > then use the data from the response to complete loading the page and avoid > having to post all of the variables from page to page to get all of the > responses back. A lot of the questions are formed based on the answers to > previous questions so I'm trying to keep the number of separate pages to a > minimum by using such a technique. I understand that Java can provide this > function, but I want to do as much with PHP and as little as possible with > Java. I think you're referring to JavaScript and NOT Java. But, whether it's Java or Javascript, you cannot really pause/stop the browser then do something to "complete loading the page." (Unless you press "stop"--but this would require you to reload.) Anyway, Javascript (if you're referring to it) doesn't have that kind of function (AFAIK). Javascript can hide/unhide element on your form. It can also enable/disable a checkbox, for example. But those functions would only work AFTER the page is already loaded--and _not_ while it is loading. (Also, *after* the Javascript file--if you're using and external one--is already downloaded inside the your visitors' disk, etc.) - E PS BTW, Javascript (support) can be turned off by your visitors--maybe you already know that... And... not all browsers supports Java. (But then again, you don't even need a browser to run Java! What am I saying here?...) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pause for user input?
"Larry Brown" <[EMAIL PROTECTED]> wrote: > The idea is to have the script start to load, prompt for a question or more, > then use the data from the response to complete loading the page and avoid > having to post all of the variables from page to page to get all of the > responses back. A lot of the questions are formed based on the answers to > previous questions so I'm trying to keep the number of separate pages to a > minimum by using such a technique. I understand that Java can provide this > function, but I want to do as much with PHP and as little as possible with > Java. I think you're referring to JavaScript and NOT Java. But, whether it's Java or Javascript, you cannot really pause/stop the browser then do something to "complete loading the page." (Unless you press "stop"--but this would require you to reload.) Anyway, Javascript (if you're referring to it) doesn't have that kind of function (AFAIK). Javascript can hide/unhide element on your form. It can also enable/disable a checkbox, for example. But those functions would only work AFTER the page is already loaded--and _not_ while it is loading. (Also, *after* the Javascript file--if you're using and external one--is already downloaded inside the your visitors' disk, etc.) - E PS BTW, Javascript (support) can be turned off by your visitors--maybe you already know that... And... not all browsers supports Java. (But then again, you don't even need a browser to run Java! What am I saying here?...) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Pause for user input?
The idea is to have the script start to load, prompt for a question or more, then use the data from the response to complete loading the page and avoid having to post all of the variables from page to page to get all of the responses back. A lot of the questions are formed based on the answers to previous questions so I'm trying to keep the number of separate pages to a minimum by using such a technique. I understand that Java can provide this function, but I want to do as much with PHP and as little as possible with Java. Larry S. Brown MCSE President/CEO Dimension Networks, Inc. Member ICCA (727) 723-8388 -Original Message- From: @ Edwin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 11:29 AM To: Larry Brown Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Pause for user input? Hello, "Larry Brown" <[EMAIL PROTECTED]> wrote: > Does anyone know of a method to pause during the processing of a script to > prompt a user for information and then incorporate the user's response for > the remainder of the script? ... in addition to what the others already said, let me just ask a couple of questions: 1. Do you really need to "pause"? What did you exactly mean by "pause"? 2. Is it even necessary to "pause"? Just wondering... - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pause for user input?
Hello, "Larry Brown" <[EMAIL PROTECTED]> wrote: > Does anyone know of a method to pause during the processing of a script to > prompt a user for information and then incorporate the user's response for > the remainder of the script? ... in addition to what the others already said, let me just ask a couple of questions: 1. Do you really need to "pause"? What did you exactly mean by "pause"? 2. Is it even necessary to "pause"? Just wondering... - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pause for user input?
No. However, I'm sure whatever you are trying to do can be designed as two pages to yield the exact same user experience. Chris --- Larry Brown <[EMAIL PROTECTED]> wrote: > Does anyone know of a method to pause during the processing of a > script to prompt a user for information and then incorporate the > user's response for the remainder of the script? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pause for user input?
Cannot be done this way, you need to use 2 pages Larry Brown wrote: Does anyone know of a method to pause during the processing of a script to prompt a user for information and then incorporate the user's response for the remainder of the script? Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pause for user input?
At 14:42 20.11.2002, Larry Brown spoke out and said: [snip] >Does anyone know of a method to pause during the processing of a script to >prompt a user for information and then incorporate the user's response for >the remainder of the script? [snip] This seems to be a very common misunderstanding of how the Web works. First as an answer to your question, you cannot do it, no way. Next, assume you're a manufacturer and send some goods to a customer, wrapped in a parcel. What you want to achieve is: when the customer eventually receives the parcel, you ask him if the address label is printed correctly. If he answers "yes" you give him a scissor to open it, if not you hand him another - now corrected - label. It's clear that this can't be done - you're at your office, and your customer is at his location. While clear in "real world" terms, this is often misunderstood for internet applications. In the example above the client browser (better: the web form) is you, the manufacturer. The customer receiving the goods is the server application. The form is displayed and filled out at the users browser, clicking on "submit" transmits the whole form content to the server for processing. >From this moment the client's out of the game. - Ok, but I have a solution. If you are able to interrupt your processing to ask the user some question, you can view your process as two parts - let's name them "PreProcess" and "PostProcess". When the user submits the form, the server starts the "PreProcess" action. At the end of the "PreProcess" action the current data status gets saved to session persistent storage, and another form is sent to the browser to answer your specific question. Eventually the user answers your question and submits this (second) form. Now the server application is fired up again, rereads the session data, and continues with "PostProcess" as you like. Everything clear? -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
[PHP] Pause for user input?
Does anyone know of a method to pause during the processing of a script to prompt a user for information and then incorporate the user's response for the remainder of the script? Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php