我有 2 个 php 页面。第一个php页面如下:
<?php
//code...
if(isset($_POST['value'])== true && empty($_POST['value']) == false){
echo"<a href='search_form_all_2.php'>See more results for </a>";
} ?>
第二页是“search_form_all_2.php”。
<?php
$value = mysql_real_escape_string($_POST['value']);
$name_and_surname = explode(" ", "$value ");
$name = $name_and_surname[0];
$surname = $name_and_surname[1];
$query = mysql_query(" SELECT `name`, `surname`, `email`, `user_id` FROM users
WHERE (surname LIKE '$name%' AND name LIKE '$surname%') OR (surname LIKE
'$surname%' AND name LIKE '$name%') ");
while($run = mysql_fetch_array($query)){
$surname = $run['surname'];
$name = $run['name'];
echo"$surname $name ";
}
?>
我想在“search_form_all_2.php”中创建 $value 以获得第一页的第一页的值if(isset($_POST['value'])== true && empty($_POST['value']) == false)
。我该怎么做,因为在运行“search_form_all_2.php”时我收到一条错误消息:注意:未定义的索引:值