functie
dus dat ik bijv. op een link klik
<a href="#" onclick="mysql update (javascript)"></a>ik vroeg mij af of dat kan
en hoe
<a href="#" onclick="mysql update (javascript)"></a><script type="text/javascript">
function onClick(href)
{
$.ajax({
type: "GET",
url: "update.php"
});
}
</script>
<img src="<?=$sql[siteimage]?>">
<a href="#" onclick="return onClick(href)">Vote!</p><?php
include("_include-config.php")
mysql_query("UPDATE `[users]` SET `cash`=`cash`+'50000' WHERE `login`='".$data['login']."'");
?><?php
if (isset($_POST['action'])) {
$field = $_POST['db_field'];
$value = $_POST['db_value'];
$link = mysql_connect("localhost", "27852", "27272");
mysql_select_db("7252", $link);
mysql_query("UPDATE `[users]` SET `belstatus`=`belstatus`+'1' WHERE `login`='".$data['login'].", $link);
mysql_close($link);
}
?>
<html>
<head>
<script type="text/javascript">
function performAjaxSubmission() {
$.ajax({
url: 'vote.php',
method: 'POST',
data: {
action: 'save',
field: $(this).attr("db_field"),
val: $(this).attr("db_value")
},
success: function() {
alert("success!");
}
});
return false; // <--- important, prevents the link's href (hash in this example) from executing.
}
jQuery(document).ready(function() {
$(".linkToClick").click(performAjaxSubmission);
});
</script>
</head>
<body>
<a href="#" class="linkToClick" db_field="field1" db_value="value1">Click here</a>
<a href="#" class="linkToClick" db_field="field2" db_value="value2">Click here</a>
<a href="#" class="linkToClick" db_field="field3" db_value="value3">Click here</a>
</body>
</html>Parse error: syntax error, unexpected T_STRING in /home/id417/domains/***/public_html/Test/vote.php on line 15