如何把一个列表中选项的值传到下个php界面中

WBOY
Release: 2016-06-13 12:48:01
Original
934 people have browsed it

怎么把一个列表中选项的值传到下个php界面中
if($roomID!=null)
{
$result=mysql_query("SELECT roomID,roomtype,roomsize FROM room WHERE roomID NOT IN (SELECT roomID FROM bookingroom WHERE bookingdate='$bookingdate' AND bookingtime='$bookingtime') AND roomID='$roomID'");
    $num_rows = mysql_num_rows($result);
if ($num_rows==0) {
echo "

Sorry, No result found. Please search again.

";
}
else{

while($row = mysql_fetch_array($result))
{
echo "";
echo "".$row['roomID']."";
echo "".$row['roomtype']."";
echo "".$row['roomsize']."";
echo "";
echo "";
}
}
}
怎么把我网页界面选择的那行数据传到insert_data.php去呢
PHP MySQL 搜索
------解决方案--------------------
<br />
echo "<td><input type=\"submit\" name=\"submit\"         value=\"Book\"onClick=\"if(confirm('Are you sure you want to book this room?'))location='insert_data.php?id=".$row['roomID']."'\")/></td>";<br />
Copy after login

在文件名后面增加ID参数,参数值为对应行数据的ID
------解决方案--------------------
get方法试试
------解决方案--------------------
通过js获取每行属性,你可以通过查找table tr td,定位到每一行,再通过url传值即可.
------解决方案--------------------
js onSubmit的时候存入cookies
在另一边php得到就行了
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template