问题描述:

Wondering if anyone can help me out here.

I have this javascript which is sending id to a php page to retrieve details.

 <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>

When I click on the tr, I do get a pop up message saying

listingDetail.php?listingid=1

Now on the php, im trying to do this to retrieve the 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>

It prints 0 here instead of 1.

Im confused why this isint working. Please help !

网友答案:

$listingid and $listingId are different vars.

        ^-lower case   ^-upper case 
相关阅读:
Top