我有以下代码,我暂时不认为它对于拍卖的目的是完整的,但它应该在这个阶段工作,尽管如此,据我所知。但我没有。只是想知道是否有人可以指出我的错误。broswer 说 php 脚本中的 else 是出乎意料的。删除它会使浏览器不期望最后的结束 html 标记。非常感谢您的任何建议。干杯
<?php
$hostuser = $_GET['user'];
$auc = $_GET['auc'];
//Connect to database
$con = mysql_connect('localhost', 'root', 'password');
$db = mysql_select_db("users");
$auction = mysql_query("
SELECT * FROM auction WHERE host = '$hostuser'
");
$row = mysql_fetch_array ($auction);
$current_bid = $row['current_bid'];
$current_bid_user = $row['current_bid_user'];
$time_started = $row['time_started'];
if ($current_bid == 0) {
$current_bid = "No bids have yet been submitted. Be the first to make a bid.";
}
include ('auction_1.php');
if ($bid > $current_bid) {
$current_bid = $bid;
$bidsubmitted = "";
{
else
$bidsubmitted = "Your bid must exceed the current bid";
}
?>
<html>
<form action = 'auction_1.php' method ='POST'>
<br>
Current bid: <?php echo $current_bid; ?>
<br>
<br>
Time Left:
<table>
<br>
<br>
<tr>
<td>
Your bid:
</td>
<td>
<input type = 'text' name = 'userbid'>
</td>
</tr>
</table>
<p>
<input type='submit' name='bid' value='Bid'>
<?php echo $bidsubmitted; ?>
</html>