그래서 양식에 이상한 문제가 발생했습니다. oplsaan 버튼을 클릭하면 (isset ($ _ POST [ 'opslaan']))의 코드를 실행하지 않습니다. 문제는 PHP가 $ _POST 배열에 양식 데이터를 저장하지 않는다는 것입니다. 예를 들어, 때 다음과 같은 형태로 opslaan 클릭PHP - 양식이 POST에 데이터를 저장하지 않습니다.
if(isset($_POST['wijzigen']))
{
$query_selecteren = 'SELECT *
FROM contacten';
$result = mysqli_query($link, $query_selecteren);
echo '<form id="wijzigingscherm" method="post" action="' . $_SERVER['PHP_SELF'] . '">';
echo '<table>
<tr>
<th>Keuze</th>
<th>Afbeelding</th>
<th>Voornaam</th>
<th>Achternaam</th>
<th>Woonplaats</th>
<th>Telefoonnummer</th>
<th>Adres</th>
<th>Postcode</th>
<th>Opmerking</th>
</tr>';
foreach ($result as $rij) {
echo '<tr>';
$rijnr%2==0 ? $rijkleur='#6B9ED1' : $rijkleur='#99B3CC';
echo '<td style="background-color' . $rijkleur .'"> <input type="checkbox" name="checkedUser" value="' . $rij['contact_id'] . '"/>';
echo '<td style="background-color'.$rijkleur.'"> <img src="ImgPersonen/profiel.jpg"/>';
echo '<td style="background-color:' . $rijkleur .'"> <input size="7" type="text" name="voornaam" placeholder="' . $rij['vnaam'] .'"/></td>';
echo '<td style="background-color:' . $rijkleur .'"> <input size="7" type="text" name="achternaam" placeholder="' . $rij['anaam'] . '"</td>';
echo '<td style="background-color:' . $rijkleur .'"> <input size="7" type="text" name="woonplaats" placeholder="' . $rij['wplaats'] . '"/></td>';
echo '<td style="background-color:' . $rijkleur .'"> <input size="7" type="text" name="telefoonnummer" placeholder="' . $rij['tnummer'] . '"/></td>';
echo '<td style="background-color:' . $rijkleur .'"> <input size="7" type="text" name="adres" placeholder="' . $rij['adres'] . '"/></td>';
echo '<td style="background-color:' . $rijkleur . '"> <input size="7" type="text" name="postcode" placeholder="' . $rij['postcode'] . '"/></td>';
echo '<td style="background-color:' . $rijkleur . '"> <input size="7" type="text" name="opmerking" placeholder="' . $rij['opmerking'] . '"/></td>';
$rijnr++;
echo '</tr>';
}
echo '</table>
<input type="submit" name="opslaan" style="width:15%;" value="Opslaan" />
<input type="submit" name="annuleren" style="width:15%;" value="Annuleren" />
</form>';
}
그것은 내가으로 session_start
if(isset($_POST['opslaan']))
{
$query_opslaan = 'a query using the post data';
mysqli_query($link, $query_opslaan) or die(mysqli_error($query_opslaan));
header('location:'.$_SERVER['PHP_SELF']);
}
아래에 위치하지만 이상한 것은 그 경우 (는 isset ($ _ POST [입니다이 코드를 실행해야합니다 'osplaan'])) 어떤 이유로 작동하지 않습니다 그리고 난 정말 내가 여기서 뭘 잘못하고 있는지 모르겠어! 누군가 내가 여기서 뭘 잘못하고 있는지 말해 줄 수 있습니까?
($를 _POST)' –
그냥 배열()과 다른 것 –