我的選擇選項沒有傳遞值。我不知道爲什麼這不起作用任何幫助將不勝感激,但我不知道發生了什麼。選擇選項不傳遞值
HTML/PHP
if(isset($_POST['submit'])){ $Name = isset($_POST['name']) ? trim($_POST['name']) :''; echo "
<a href='index.php'>
<-- Your Home Page</a>
</br>
</br>"; echo "
<table border='1'>
<form action='' method='post'>
<tr>
<th>Name</th>
<th>Car</th>
<th>Night</th>
<th>Siteid</th>
<th>Date</th>
<th>LHA</th>
<th>AAS</th>
<th>LS</th>
<th>Update</th>
</tr>"; $sql = "SELECT * FROM data WHERE Name = '$Name' ORDER BY Date"; $sth = $pdo->query($sql); while($row = $sth->fetch()) { $Car = $row['Car']; echo "
<form action='' method='post'>"; echo "
<tr>"; echo "
<td>" . $row['Name']. "</td>"; echo "
<td>
<input type='text' name='Car' placeholder='".$row[' Car ']."' value=''>
</td>"; echo "
<td>
<input type='text' name='Car' placeholder='".$row[' Night ']."' value=''>
</td>"; echo "
<td>
<input type='text' name='Car' placeholder='".$row[' Siteid ']."' value=''>
</td>"; echo "
<td>
<input type='text' name='Car' placeholder='".$row[' Date ']."' value=''>
</td>"; echo "
<td>
<input type='text' name='Car' placeholder='".$row[' LHA ']."' value=''>
</td>"; echo "
<td>
<input type='text' name='Car' placeholder='".$row[' AAS ']."' value=''>
</td>"; echo "
<td>
<input type='text' name='Car' placeholder='".$row[' LS ']."' value=''>
</td>"; echo "
<input type='hidden' name='PID' value='".$row[' PID ']."' />"; echo "
<td>
<input type='submit' name='submit' value='".$row[' PID ']."' />
</td>"; echo "</tr>"; echo "</form>"; } echo "</table>"; $pdo = NuLL; }Else{ Echo "Pick a user"; } ?>
HTML表單
<form action="" method="POST">
<select name="name" id="name">
<?php foreach ($data as $row): ?>
<option value="<?=$row['user_id']?>">
<?=$row[ "user_name"]?>
</option>
<?php endforeach ?>
</select>
<input type="submit" value="submit">
</form>
'<期權價值=「」>'就是爲什麼沒有被傳遞的值。你將它設置爲'「」'。 – 2014-10-10 09:51:06
您的選擇選項沒有值'