Confirmation message on user input in php
<p>I have a doubt in the following code. I have a single function for both Insert and Update. Based on the row count each function will be executed. I want to provide a Confirmation box before performing the operation. On cancel message it should not perform the function. How can I do this?<br>
Following is the code:</p>

<pre><code>if (isset($_POST['Save']))

{

$query = "SELECT * FROM `table_name` WHERE `submission_id` = '$submission_id'";

$sqlsearch = mysql_query($query);

$resultcount = mysql_num_rows($sqlsearch);


if ($resultcount &gt; 0) 
{
mysql_query("UPDATE `table_name` SET 
    `name` = '$name',
    `email` = '$email',
    `phone` = '$phonenumber',
    `subject` = '$subject',
    `message` = '$message' 
    WHERE `submission_id` = '$submission_id'") or die(mysql_error());
} 
else 
{
mysql_query("INSERT INTO `table_name` (submission_id, formID, IP, 
    name, email, phone, subject, message) 
    VALUES ('$submission_id', '$formID', '$ip', 
    '$name', '$email', '$phonenumber', '$subject', '$message') ") or die(mysql_error());
        }
    }
?&gt;`
</code></pre>
