4

I have a php/mysql project. When the admin deletes a customer or product from the database on the form I need an confirm box to show and ask the admin if they are sure they want to delete and have the customer row show in the confirm also.

Here is my form

<main>
    <form class = "form" method = "post" action = "customerdeleted.php">
        <div class = "grayContainerProduct">
            <div class = "formContent">
                <div class = "productTitle">
                    Delete A Customer
                </div>
                <div class = "field">
                    <label class = "productText" for = "id">Customer ID</label>
                    <input class = "productInput" id = "id" name = "id" type = "text">

                    <div class = "buttonDiv">
                        <input type = "submit"class = "button"  id = "buttonDelete" value = "Delete">
                    </div>
                </div>
            </div>
    </form>
</main>

Cheers

Edited by pritaeas: Closed.

Votes + Comments
tested
youre a php
3
Contributors
2
Replies
14
Views
3 Years
Discussion Span
Last Post by pritaeas
1

This should probably be in the PHP forum as it isn't really a database question but never mind that...
You can use javascript to show a confirm window and if the action is confirmed call the relevant page with a parameter set. The called php page then reads the parameter on page load and acts accordingly.
You can pass data into the confirm box so it can show the data being deleted.
Or you can create a confirm box yourself with CSS and javascript if you want something more stylised.
Here's a forum question with an answer