here's the page where you select the info to delete
<?
$query2 = "SELECT * FROM packages ORDER BY pack_name ASC";
$result = mysql_query($query2);
while($row=mysql_fetch_array($result)) {
$_POST["id"];
?>
<?
echo "<table width=\"70%\" align=\"center\" border=1>";
echo "<tr>";
echo "<td width=\"100%\" align=\"center\"><a href=\"hostdelete.php?id=".$row["0"]."\">".$row["2"]."</td>";
}
echo "</tr></table>";
?>
and here's the actual delete script.....
<?
$id=$_GET["id"];
if ($submit) {
$query = "DELETE FROM packages WHERE id=$id";
mysql_query($query);
print("Deleted hosting package $pack_name successfully");
?>
<?
}
else
{
$query2 = "SELECT * FROM packages WHERE id=$id";
$result = mysql_query($query2);
$row = mysql_fetch_array($result);
?>
<table width="80%" align="center">
<tr>
<td width="100%">
<table width="30%" align="center" border=1>
<tr>
<td width="100%" align="center"><b><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Delete
A Package</font></b></td>
</tr>
</table>
</td>
</tr>
<p> <p>
<tr>
<td width="40%">
<form action="hostdelete.php" method="post">
<table width="70%" align="center">
<tr>
<td>
Package #:<br><input type="text" name="pack_id" value="<? echo $row["1"]; ?>"></td>
<td>
<div align="right">Package Name:
<input type="text" name="pack_name" value="<? echo $row["2"]; ?>">
</div>
</td></tr>
<tr><td><input type="hidden" name="processor" value="1.7GHZ">
<input type="hidden" name="ram" value="2.0GIGS">
Bandwidth:<br><input type="text" name="bandwidth" value="<? echo $row["3"]; ?>"></td>
<td align="right">Upload(MB/month):<input type="text" name="transfer" value="<? echo $row["6"]; ?>"></td>
<tr><td valign="top">Disc space:<br>
<input type="text" name="space" value="<? echo $row["7"]; ?>"><br>
Paypal link:<br><textarea name="paypal" value="<? echo $row["8"]; ?>"></textarea></td>
<td>Description:<br>
<textarea name="description" rows="5" cols="45" value="<? echo $row["9"]; ?>"><? echo $row["9"]; ?></textarea></td></tr>
<tr><td></td><td align=right>
<input type="submit" name="submit" value="Delete Package"><input type="reset" value="Clear Form">
</td>
</tr>
</table></form>
now i have a form being displayed on this page, that shows hte info... to make sure this is what you want to do.....
it does not throw me erros but it also does not delete the form, neither does it show the my info in the fields as i want..
one more question..
how do you make a form that you submit add info into a database, and send an e-amil that it has been done at the same time?
and have a confirmation... so like
if($submit) {
echo ("Order Confirmation");//print the table order...
} else {
//show the form to order
}
but then on the order confirmation page, it would need a submit button too..
wait nm i think i know, basically do the above and then have a if ($submit2) { do this } else { do this} inside the the { for order confirmation }
yes? i think i got it 🙂
but how do i delete 🙁 i also tried to use "DELETE * FROM etc";
and nothign works.. this is the exact same script i'm using to update and that works great, any help is greatly appreciated.
thanks