私は次のコードを持っていますが、オークションの目的でしばらくは完成していないと思いますが、私が見る限り、この段階では機能するはずです。しかし、私はしません。誰かが私の間違いを指摘できるかどうか疑問に思った. ブラウザによると、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>