Forum Moderators: coopster

Message Too Old, No Replies

Pop up message with PHP?

Confirmation message popup

         

neophyte

3:26 am on Aug 22, 2004 (gmt 0)

10+ Year Member



I'm building a php admin section which allows the editing and deletion of records from a database.

For the deletion portion, I want to issue a confirmation message box when the user clicks the "delete" button saying "are you sure you want to delete this row" with "Yes" and "Cancel".

I know this can be done via javascript, but is it possible through PHP? I'd think not since the pop up would be client-side (wouldn't it?).

And, what if the users browser has javascript disabled?

Is this possible? And if so...how?

Thanks to all in advance!

Neophyte

Warboss Alex

6:55 am on Aug 22, 2004 (gmt 0)

10+ Year Member



It doesn't work in PHP.

And always assume the user has javascript disabled. Use it to add and enhance, never for basic functionality.

neophyte

8:29 am on Aug 22, 2004 (gmt 0)

10+ Year Member



That was my assumption ... that you couldn't do it in PHP.

So...assuming the person does have javascript disabled, how does one produce a message/confirmation box (without javascript) that is certain to work?

Adrian2k4

6:20 pm on Aug 23, 2004 (gmt 0)

10+ Year Member



I'm not aware of a method to do this without javascript. What you can do is generate HTML with your PHP script with two links "ok" and "cancel" which the user can click. Probably works best with session-ids etc.
If you want to do this with javascirpt create a page at the beginning of your project stating that javascipt is needed to view the page and a javascirpt-redirect to the next page that triggers imediatly.
That way if the user has javascript he will be redirected emediatly as the header is loaded and if he hasen't got javascript he gets the message to use a browser that supports javascript or to change his security settings.

WhosAWhata

11:47 pm on Aug 23, 2004 (gmt 0)

10+ Year Member



create the javascript function, then with the noscript tag, create a plain html site.

neophyte

4:21 am on Aug 24, 2004 (gmt 0)

10+ Year Member



Thanks to all for the input on my question. I'll try the last few suggestions made.

Neophyte