我有这个代码的问题:腓传递值
<?php echo "<meta http-equiv='refresh' content='3;search_enroll.php?&id='.$id />"; ?>
我使用这个代码在此页面上的值传递与$id
这个页面,它不是空的我附和$id
并持有价值。这是在接收端代码:
<?php
if (isset($_POST['SearchS'])){
$id = $_POST['searchstudent'];
}else if(!empty($_GET['id'])){
$id = $_GET['id'];
}
else if(!empty($_GET['student_id'])){
$id = $_GET['student_id'];
}
else {
$id= $_REQUEST['student_id']; <--- this is line 37
}
?>
目前有此错误的音符,我希望第二else
语句应该获取的代码。
Notice: Undefined index: student_id in C:\xampp\htdocs\Thesis\search_enroll.php on line 37
你的字符串搞砸了,算你报价。另外,在对它们做任何事情之前,一定要清理任何变量。即:addslashes,检查是否是数字等 –