At 11:03 AM 5/29/2006, siavash1979@xxxxxxxxx wrote:
Is there anyway to have a pop-up window to ask "are you sure? yes /
no" in php?
I know you can do it in Javascript, but I'm not sure what's the best way to
implement it in php. I want the page to do nothing if "no" is pressed.
With all due respect to my learned colleagues, my answer to your
question is yes, you can accomplish your goal using just PHP.
I assume that you understand that PHP is not a client-side language
and therefore cannot, by itself, produce a real-time,
operating-system-generated pop-up dialog box in the same way that
JavaScript can.
However, PHP can download a page with input fields disabled that
includes a div styled to look like a dialog box with a couple of
submit buttons labeled YES & NO. Submitting YES will request the
same page from PHP but without the dialog div and with user interface
fields enabled; NO will request the same page but without the dialog
div and with UI fields disabled.
From the user's point of view, the main difference between doing
this with PHP and doing it with JavaScript is that the PHP solution
will take at least a few seconds for the round-trip to the server
whereas JavaScript's response to a confirm() dialog will seem instantaneous.
Regards,
Paul
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php