传递到其他PHP页面的PHP url参数
我无法通过url参数将值传递到其他页面。我想通过单击“拒绝”按钮,根据所选bookingID拒绝预订。但是bookingID值不会传递到其他页面,url如下所示 这是我的编码部分: index.php传递到其他PHP页面的PHP url参数,php,url,parameters,Php,Url,Parameters,我无法通过url参数将值传递到其他页面。我想通过单击“拒绝”按钮,根据所选bookingID拒绝预订。但是bookingID值不会传递到其他页面,url如下所示 这是我的编码部分: index.php <head> <script src="jquery-latest.js" type="text/javascript"></script> <script src="jquery.tablesorter.js" type="text/javascript
<head>
<script src="jquery-latest.js" type="text/javascript"></script>
<script src="jquery.tablesorter.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
$("#myTable").tablesorter({widgets: ['zebra']});
});
$(document).ready(function()
{
$("#myTable").tablesorter();
}
);
$(document).ready(function()
{
$("#myTable").tablesorter( {sortList: [[0,0], [1,0]]} );
}
);
</script>
<link href="style.css" rel="stylesheet" type="text/css">
<link href="stylelogin.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php
include("dbconfig.php");
$query = "SELECT customer.companyName, customer.contactName, eventinfo.eventTitle,boothAlias,date, testbook.bstatus, testbook.username, bookingID from eventinfo, testbook, customer where testbook.username=customer.username AND testbook.eventID=eventinfo.eventID";
$o = '<table id="myTable" class="tablesorter" width="930px"><thead><tr><th>Company Name</th><th>Contact Name</th><th>Event</th><th>Booth</th><th>Date</th><th>Status</th></tr></thead><tbody>';
$result = mysql_query($query);
while($row=mysql_fetch_array($result))
{
$boothAlias=stripslashes($row["boothAlias"]);
$eventTitle=stripslashes($row["eventTitle"]);
$date=stripslashes($row["date"]);
$bstatus=stripslashes($row["bstatus"]);
$companyName=stripslashes($row["companyName"]);
$contactName=stripslashes($row["contactName"]);
$bookingID=stripslashes($row["bookingID"]);
if($bstatus==0){
$status="Pending";
}else if($bstatus==1){
$status="Successful";
}else{
$status="Reject";
}
$o .= '<tr><td width="120px">'.$companyName.'</td><td width="120px">'.$contactName.'</td><td width="180px">'.$eventTitle.
'</td><td width="70px">'.$boothAlias.'</td><td width="170px">'.$date.'</td><td width="70">'.$status.'</td><td>'.$bookingID.'
</td><td width="100"><input type="hidden" name="bookingID" value="<?php echo $bookingID; ?>" ><a href="approve_booking.php?bookingID=".$bookingID.
" name="REJECT" id="REJECT"><input width="100px" name="REJECT" type="submit" id="REJECT" value="Reject"></a></td></tr>';
}
$o .= '</tbody></table>';
echo $o;
?>
</body>
$(文档).ready(函数(){
$(“#myTable”).tablesorter({widgets:['zebra']});
});
$(文档).ready(函数()
{
$(“#myTable”).tablesorter();
}
);
$(文档).ready(函数()
{
$(“#myTable”).tablesorter({sortList:[[0,0],[1,0]});
}
);
我真的不知道您的问题是什么,但请尝试$\u REQUEST['..''']而不是$\u GET[''..']
顺便说一下,您有一个SQL注入漏洞:
$booking=$_GET['bookingID'];
替换为:
$booking=mysql_escape_string($_GET['bookingID']);
这里有很多无效的语言用法。您的具体问题:
'</td><td width="100"><input type="hidden" name="bookingID"
value="<?php echo $bookingID; ?>" >
<a href="approve_booking.php?bookingID=".$bookingID." name="REJECT"'
'1)小心SQL注入2)删除错误抑制器,特别是在开发环境中3)如何传递查询字符串?我只看到一张残缺的表格。如果它使用GET方法,那么这两篇文章在哪里生成?4) 是的,你的问题到底是什么?你是不是把GET&POST请求搞混了?GET变量将通过URL传递,并且可以使用$\u GET['']获取,而POST则通过html表单发送。您是否也知道$\u会话?
'</td><td width="100"><input type="hidden" name="bookingID"
value="<?php echo $bookingID; ?>" >
<a href="approve_booking.php?bookingID=".$bookingID." name="REJECT"'