[PHP] cancelling
Hi, I would appreciate help on the following. I have been looking up ways to implement a cancel button with php. Basically, I have a mypictures.php file. There are select statements, grep statements, and a call to executables. I don't understand why there isn't that much around about this cancel topic? Have I been looking in the right places? The cancel button can be used if the user does not want to wait a long time for a big request and wait for the pictures to render. Also, I have had problems with the executables tying up the server. They can use the big stop button at the top of the Internet Explorer I think but I would like to make it user friendly and have the option to cancel in the php application itself. I want the cancel button to also direct the user to a page ready for a new search. Can I use posix_get pid and then posix_kill to kill the current instance of mypictures.php. Will this work? I'm not sure how to kill the executables started by this particular mypictures.php. Other people can open another session and I don't want to kill their mypictures.php or executables that they started. What is the difference between posix_getpid() and getmypid()? Are they the same thing? For the cancel button I was thinking of using a popup window or just use the mypictures.php that the top header part of the mypictures.php that is rendering and use an XML HTTP Request object to be able to cancel without sending another request. Are these ideas practical and possible? thanks! - Post your free ad now! Yahoo! Canada Personals
RE: [PHP] cancelling
newbie c mailto:[EMAIL PROTECTED] on Tuesday, April 05, 2005 11:03 AM said: Are these ideas practical and possible? Practically speaking? It seems like a waste of time. What are these executables doing? The stop button on the browser or clicking a link to a new page should suffice. As for possibility, that I don't know. I don't think you'll find the answer you want since HTTP is stateless. It seems that you'd have to send another request to the server to tell it to interrupt the current process. Your cancel button should probably just go to the new search page. Won't it cancel the process on it's own by abandoning the request? Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cancelling
You might find this section in the manual helpful... never done it myself though... http://us2.php.net/manual/en/features.connection-handling.php On Tue, 5 Apr 2005, newbie c wrote: Hi, I would appreciate help on the following. I have been looking up ways to implement a cancel button with php. Basically, I have a mypictures.php file. There are select statements, grep statements, and a call to executables. I don't understand why there isn't that much around about this cancel topic? Have I been looking in the right places? The cancel button can be used if the user does not want to wait a long time for a big request and wait for the pictures to render. Also, I have had problems with the executables tying up the server. They can use the big stop button at the top of the Internet Explorer I think but I would like to make it user friendly and have the option to cancel in the php application itself. I want the cancel button to also direct the user to a page ready for a new search. Can I use posix_get pid and then posix_kill to kill the current instance of mypictures.php. Will this work? I'm not sure how to kill the executables started by this particular mypictures.php. Other people can open another session and I don't want to kill their mypictures.php or executables that they started. What is the difference between posix_getpid() and getmypid()? Are they the same thing? For the cancel button I was thinking of using a popup window or just use the mypictures.php that the top header part of the mypictures.php that is rendering and use an XML HTTP Request object to be able to cancel without sending another request. Are these ideas practical and possible? thanks! - Post your free ad now! Yahoo! Canada Personals -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cancelling
The executables are taking the user's input and going to the database to grab and cut out the pictures that are corresponding to the user's search term. I understand the stop button may solve some problems and I am going to test this some more. But there is still the need to stop a user from making some huge request then going away for a couple of days. I don't want to restrict the requests of a user however how can I stop them from monopolizing the server? thanks! Chris W. Parker [EMAIL PROTECTED] wrote: newbie c on Tuesday, April 05, 2005 11:03 AM said: Are these ideas practical and possible? Practically speaking? It seems like a waste of time. What are these executables doing? The stop button on the browser or clicking a link to a new page should suffice. As for possibility, that I don't know. I don't think you'll find the answer you want since HTTP is stateless. It seems that you'd have to send another request to the server to tell it to interrupt the current process. Your cancel button should probably just go to the new search page. Won't it cancel the process on it's own by abandoning the request? Chris. - Post your free ad now! Yahoo! Canada Personals
RE: [PHP] cancelling
newbie c mailto:[EMAIL PROTECTED] on Tuesday, April 05, 2005 12:23 PM said: The executables are taking the user's input and going to the database to grab and cut out the pictures that are corresponding to the user's search term. I can only guess then that these executables could not be replaced by a regular PHP script? I understand the stop button may solve some problems and I am going to test this some more. But there is still the need to stop a user from making some huge request then going away for a couple of days. I don't want to restrict the requests of a user however how can I stop them from monopolizing the server? I see. In that case a cancel button isn't going to help you (at least, it won't be a solution). What if the user starts the process, doesn't press your cancel button, and goes away for a couple of days? You've got a cancel button but it didn't get pressed. Since we don't have any details of these executables wouldn't the executable return control back to whatever it was that called it after it was done processing? I mean, if I put in some search terms in google and walk away for a few days, google has no idea I've left. Nor do they even care. In the same way, your executables shouldn't run continuously without user intervention. They should know when they are done and should stop. At that point, monopolizing the server becomes a non-issue. Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php