This seems very textbook, but it isn't working. Once I carry over the variables (which it does do correctly) the delete query doesn't work. Anyone know why this may be? (NOTE: This is a small snippet, the actual code is much longer, so I really didn't forget the $connect variable or <?php)
PHP Code:if(isset($_POST['submit'])){
// Get linkid from url
$linkid = $_GET['linkid'];
// Delete the link
$result=mysql_query("DELETE FROM links WHERE linkid=$linkid ",$connect);
echo "<font size=5 color=red><b>Record Deleted!</b></font><br>
<font size=2>You will now be redirected to the Main Page in 3 seconds</font><br><br>";
include "footer.php";
echo "<meta http-equiv=Refresh content=3;url=index.php>";
}
// If form not being submited... well then display the thing
else{
?>
<table width='100%'>
<tr>
<td colspan='2'><center>
<font color='red' size='5'><b>Are you sure you want to delete<br>
the link to</font><font size='5'> <?php echo $name; ?>?</b></font>
</td>
</tr>
<tr>
<td align='right' width='35%'>
<form method="post" action="<?php echo $PHP_SELF ?>">
<input style='font-weight: bold; font-size: x-small;color: #FFFFFF;background-color:RED;letter-spacing:1px;height:20px;border-style:solid;border-width:1px;border-color :#000000;' type="submit" name="submit" value=" YES ">
</form>
</td>
<td align='left' width='65%'>
<form method="post" action="index.php">
<input style='font-weight: bold; font-size: x-small;color: #FFFFFF;background-color:green;letter-spacing:1px;height:20px;border-style:solid;border-width:1px;border-color :#000000;' type="submit" name="submit" value=" NO ">
</form>
</td>
</tr>
</table>








Bookmarks