php - How to show a yes or no before deleting a record without using javascript? -
i want display message using php says want delete record ? yes or no. please
echo "<tr bgcolor='#cccccc'><td>$hometeam</td> <td>vs</td><td>$awayteam</td><td>$date</td><td>$venue</td><td><a href='fixtures.php?fixture_id=$fixture_id&edit=1' name='edit' >edit</a></td><td><a href='fixtures.php?fixture_id=$fixture_id&delete=1' name='delete'>delete</a></td></tr>";
in fixtures.php, have check delete
field of $_get array , add confirmation. using php :
if (! empty ($_get['delete']) && ! empty ($_get['fixture_id']) && empty ($_get['confirm'])) { $fixture_id = intval($_get['fixture_id']); echo "are sure want delete record ?<br />"; echo "<a href='fixtures.php?fixture_id=$fixture_id&delete=1&confirm=1'>yes</a> - " echo "<a href='fixtures.php?fixture_id=$fixture_id'>no</a> - " } else if (! empty ($_get['delete']) && ! empty ($_get['fixture_id']) && ! empty ($_get['confirm'])) { mysqli_query ("delete fixtures fixture_id=".intval($_get['fixture_id'])); }
Comments
Post a Comment