내 코드에서 deleteQns.php
페이지로 이동하려고하지만, 항상 administrator(Quiz2)
으로 리디렉션되므로 거기에있는 것처럼 보일 수 없습니다. 나는 틀린 것을 모른다. 나는 너희 모두가 나를 도울 수 있기를 바랍니다.리디렉션 될 수 없습니다.
<?php while($row=$ result->fetch_array(MYSQLI_ASSOC)) { ?>
<tr class="size">
<form id="button" action="administrator(Quiz2).php" method="post">
<th>
<p>No.
<?=$row[ "questionid"]?>
</p>
</th>
<th>
<?=$row[ "questiontext"]?>
</th>
<th class="editanddelete">
<input type="hidden" name="qid" value="<?=$row[" questionid "]?>">
<input type="submit" value="Edit" name="editbtn">
</form>
<form id="delete" action="deleteQns.php" method="post">
<button onclick="myFunction()">Delete</button>
<input type="hidden" name="qid" value="<?=$row[" questionid "]?>">
<p id="demo"></p>
<script>
function myFunction() {
var x;
if (confirm("Are You Sure You Want To Delete This Question?") == true) {
window.location = "deleteQns.php";
} else {
x = "";
}
document.getElementById("demo").innerHTML = x;
}
</script>
</form>
<?php } ?>
보통 코드가 질문이나 해결할 수있는 문제에 응답하는 방법을 설명 텍스트를 포함하는 것이 도움이된다 맨손으로 코드에 문제가 있습니다. – Makyen
@Makyen 답변이 업데이트되고 수정되었습니다. 서둘러 – VeeeneX