我不知道我的代码有什么问题。PHP 有点新
这是我的html代码
<html>
<body>
<form action="sample2.php" method="POST">
<input type="submit" value="occupied" id="occupied">
<input type="submit" value="reserved" id="reserved">
<a name="slot1" style="background-color: green; width:100px; height:100px; border-top-right-radius:0px; border: 2px
solid Black;float:left; position:absolute; top:400px; left:441px;">
</form>
</body>
</html>
PHP代码在这里
<?php
$con=mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("sample");
if(isset($_POST['occupied'])){
$query="UPDATE reservation SET status='occupied' where status='vacant'";
echo "<a style=background-color: red; width:100px; height:100px; border-top-right-radius:0px; border: 2px
solid Black;float:left; position:absolute; top:400px; left:441px;>";
}
?>
我的问题是每当我点击被占用的按钮时,框的颜色不会从绿色变为红色,它只会将我引导到一个空白页面。帮助