我需要通过 URL 栏将变量传递给我的其他页面。我有一个错误: 注意:Undefined index: $id in C:\xampp\htdocs\Kyle_Site\Programming Rite\controle\delete.php on line 3
我假设我没有正确传递这个错误,但我不确定是否有任何帮助!
我在这里传递变量:
<a href="delete.php?id=<?php echo $username['id'] ; ?>">Delete</a></td>
这是应该传递变量的位置:
<?php
require 'core.inc.php';
$id = $_GET['$id'];
if (isset($_POST['delete'])) {
$answer = $_POST['decision'];
if ($answer == 'yes') {
echo 'user deleted'; }
}
echo '<h1>Are you sure you want to delete '.$id.'?</h1>
<form name ="form1" method ="POST" action ="delete.php">
<input type="radio" name="decision" value="yes">Yes
<input type="radio" name="decision" value="no">No
<input type="submit" name="delete" value="Delete">
</form>';
?>