我有一个像这样的html表单:
<form method="post" action="input.php">
<label for="name">NAME</label>
<input type="text" name="name" size="20">
<label for="address">ADDIE</label>
<input type="text" name="address" size="40">
<input type="submit" name="submit" value="Send">
我有:
<?php
mysql_connect("localhost","formuser","password") or die(mysql_error());
mysql_select_db("formpractice") or die(mysql_error());
$name = $_POST['name'];
$address = $_POST['address'];
$query = "INSERT INTO Users(name, address) VALUES ('$name', '$address')";
$qresult = mysql_query($query);
if ($qresult) {
echo "Success";
} else {
echo "Failed to submit";
}
?>
我正在尝试这个:
<form method="post" action="input.php">
<label for="name">NAME</label>
<input type="text" name="name" size="20">
<label for="address">ADDIE</label>
<input type="text" name="address" size="40">
<input type="submit" name="submit" value="Send">
// Here is where I get trouble. How do I get this button to execute a delete statement?
<input type="submit" name="Delete" value="Delete">