Member Avatar for [NOPE]FOREVER

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

joyc123 commented: youre a php +0
thelove commented: tested +0

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.