I'm trying to delete a mysql record with javascript but I fail.
So this is my js function
function delpost(id){
if(confirm('Are you sure?')){
$('#comment_'+id).hide();
http.open("get","/index.php?p=delcomment&id=" + id, true);
http.send();
}
}
And this is my delcomment.php(included through index.php)
$comment_id = $_GET['id'];
if(logged() && $status=="administrator"){
$delquery = mysql_query("DELETE FROM comments WHERE id='$comment_id' LIMIT 1");
die();
}else{
die();
}
I hope you can help me with this :)