我有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」的$值來獲得,我在第1頁的if(isset($_POST['value'])== true && empty($_POST['value']) == false)
第一頁的價值。注意:未定義指數:我怎麼能因爲運行時「search_form_all_2.php」我得到一個錯誤回報訊息爲此值
存儲值在會話中,或者將它們傳遞作爲查詢字符串參數'鏈接。 –