想知道是否有人可以帮助我。
我有这个javascript,它将id发送到php页面以检索详细信息。
<script>
$(document).ready(function() {
displayListings();
$("#listTb").on("click", "tr", function() {
var url = "listingDetail.php?listingid="+this.id;
alert("directing to : " + url);
window.open(url);
});
});
</script>
当我点击tr时,我会收到一条弹出消息,说
listingDetail.php?listingid = 1
现在在php上,我试图这样做来检索id:
<body>
<?php
$listingid = 0;
if(!isset($_REQUEST['listingid'])){
exit;
}else{
$listingId = $_REQUEST['listingid'];
}
?>
</body>
<table id="listTb" >
<tbody>
<tr>
<td>....<?php echo htmlentities($listingid); ?>.......</td>
</tr>
</tbody>
</table>
此处打印0而不是1。
我很困惑为什么这不起作用。请帮忙!
答案 0 :(得分:0)
$listingid
和$listingId
是不同的变种。
^-lower case ^-upper case