I'm trying to do a POST query with jquery on my website online but I get the error 500 Internal Server Error, this and the query (jquery):
$('#background').load('map_page.php', {'a':'see_member', 'id': id});
The block that receives this query in the page map_page.php (php):
if($a == 'see_member') {
$id = @$_POST['id'];
if($id) {
$q = $dbAgent -> query("select * from map where id=$id");
$a = $dbAgent -> fetch($q);
$logo = $a['logo'];
$title = $a['name'];
$desc = $a['description'];
$address = $a['address'];
echo "
<a href='#' onclick='closeCompany($id)'>
<img src='media/cancel.png' id='close'>
</a>
<img src='$logo' id='prof'>
";
$r1 = $a['rate_1']; $r2 = $a['rate_2'];
$r3 = $a['rate_3']; $r4 = $a['rate_4'];
$r5 = $a['rate_5'];
$allStars = array(
0=>0, 1=>$r1, 2=>$r2, 3=>$r3,
4=>$r4, 5=>$r5
);
$biggestStar = 0;
for($i=1;$i<count($allStars);$i++) {
$st = $allStars[$i];
if($st > $allStars[$biggestStar]) {
$biggestStar = $i;
}
}
$NUM_STARS = 5;
if(!$clientTools -> rated($id)) {
echo "<span class='rate_stars' id='rate_stars' onmouseenter='setVoteAble($NUM_STARS,$id)'
>";
}
else {
echo "<span class='rate_stars' id='rate_stars'>";
}
for($i=1;$i<count($allStars);$i++) {
if(($allStars[$i] < $allStars[$biggestStar] and $i < $biggestStar) or $i == $biggestStar) {
echo "<img class='rate_star' id='rate_star_$i' src='/media/star_fill.gif'>";
}
else {
echo "<img class='rate_star' id='rate_star_$i' src='/media/star_bg.gif'>";
}
}
$numVotes = $allStars[$biggestStar];
echo "<br><span id='numVotesStars'>$biggestStar estrelas. ($numVotes votos)</span>";
echo "</span>";
echo "
<div class='p_map'>
</div>
";
echo "
<div id='cont'>
<center><text id='header'>$title</text></center>
<br><br>
<text id='content'>$desc</text>
<br><br>
<text id='content' style='font-weight: bold'>$address</text>
</div>
";
return;
}
}