我有这个php:
$sql = mysql_query("select * from asset where
name like '%$search%' or
barcode like '%$search%' or
serial like '%$search%' ");
while ($row = mysql_fetch_array($sql)){
echo '<br/> Name: '.$row['name'];
echo '<br/> Barcode: '.$row['barcode'];
echo '<br/> Serial: '.$row['serial'];
}它显示在一个名为search.php的页面上,但是,我希望该文件重定向到显示回显文本的静态html页面
发布于 2014-04-14 03:46:40
您可以将结果保存在数组中,并重定向到传递此数组的其他页面。可能是这样的-
$results = array();
while ($row = mysql_fetch_array($sql)){
array_push($results, $row);
}
$result_json = json_encode($results);
header('Location: {my-html}?results='.$result_json);然后在您的html中,获取此字符串并对其进行相应的操作。
https://stackoverflow.com/questions/23047541
复制相似问题