<script type="text/javascript">
function reportPost(args, id) {
var reason = prompt("Reason");
if (reason == null || reason == "") {
return false;
}
$.ajax({
type: "POST",
url: "testajax.php",
data: "reason=" + reason + "&" + args,
success: function(msg) {
var reportSpan = document.getElementById('report' + id);
reportSpan.parentNode.removeChild(reportSpan);
}
});
}
</script>
<span id="report<?php echo $pid ?>"><a href="#" onclick="reportPost('post_id=<?php echo $pid ?>', <?php echo $pid ?>);return false;" rel="nofollow"><img src="exclamation.png" alt="Report" /></a></span>
Tout ce que j'ai en ajax.php est:ajax ne veut pas travailler
mysql_query("INSERT INTO reports (message) VALUES ('test')");
Rien ne s'ajouté à cette table et je suis connecté moi confiance
est-ce que "testajax.php" devrait être "/testajax.php"? – Trey
La recette habituelle: ff & firebug, activer NET, voir la requête et/ou les erreurs javascript. – Wrikken
des erreurs sont-elles retournées? – Neal