What I want to do is have a confirmation page between the deletion of the MySQL record, I want to have buttons, one saying "Yes" one saying "No". No will redirect to the previous page and Yes will continue with the deletion of the record, by the ID selected in editskill.php.
But I can't figure out how to do this without JavaScript and without making another 20+ files for each different page I have. Because I have editnews.php as well plus others which I want to be able to delete with a confirmation.
If anyone could help I'd appreciate it.
I have editskill.php
<th width="100%"><left><font color="#FFFFFF" size="1"><b><a href="editskill.php?id={$arr['id']}">{$arr['guidename']}</a></b></font></left>
<th><font color="#FFFFFF" size="1"><b><form action="deleteskill.php" method="post">
<input type="hidden" name="id" value="{$arr['id']}">
<input type="Submit" value="Delete">
</form>
I also have deleteskill.php
<?php
$con = mysql_connect("*");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("*", $con);
$sql="DELETE FROM skills WHERE `id` = '$_POST[id]'";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "<font color='#FFFFFF' size='2'>1 record deleted</font>";
mysql_close($con)
?>