PHP: Show yes/no confirmation dialog

后端 未结 13 2079
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-30 18:27

My PHP page has a link to delete one MySQL table datum. I want it to be in such a way that when I click the \'delete\' link a confirmation box should appear and it should ask \

13条回答
  •  深忆病人
    2021-01-30 18:52

    The PHP way of doing this would be using a dialog system inside php.for example GTKDialogs: http://www.kksou.com/php-gtk2/articles/setup-a-dialog-box---Part-2---simple-yes-no-dialog.php The javacript way is probably a bit easier, but remember when javascript is turned off, this does not work (except if you check javascript to be enabled and then add this!?) This could be with a onclick handler like tsvanharen posted, or with a simple text dialog inside the page instead of a nagging popup.

    
    
    

    I use prototype (hence the $() tag and the show()/hide()) for it. but you can easily change it to work without prototype:

    click here to delete
    
    

    Again, this does not work without javascript, but almost no options do.

提交回复
热议问题