Javascript Confirm Delete in One PHP File (on href)


You can set the onclick attribute of the link. If the function returns false, the link will not proceed.

<a href="deletephone.php?id=' . $row['id'] . '" onclick="return confirm('Are you sure?');">Delete Phone</a>


Here, the confirm() function will return true if the user pressed OK, and false if the user pressed Cancel.

Comments

Popular posts from this blog

How can I debug PHP cURL sessions?

Free icons

how to create template file in php. why it is usefull