내 선택 옵션이 값을 전달하지 않습니다. 왜 이것이 도움이되지 않을지 모르겠지만, 어떤 일이 일어나고 있는지 전혀 모른다. 당신이 당신의 옵션 태그 값이 없기 때문에값을 전달하지 않는 옵션 선택
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>
'<옵션 값이 = "">는'이다. 당신은''''으로 설정하고 있습니다. –
선택 옵션에 값이 없습니다.