I'm implementing some code that alerts users that my site is using cookies. If they consent I want to update my mysql database with the consent (eg 'yes' or 'no'). I got the current code from this site and it works great.
Currently it just prints the approval in the console(user approves) but I'm unsure how I should go about sending this data to php. I understand how to save to my database with php, it's just passing the data from jquery to php that I'm not sure how to go about. I do know a little ajax...
<script type="text/javascript">
$(document).bind("user_cookie_consent_changed", function(event, object) {
// true or false
console.log("User consent: " + $(object).attr('consent') );
});
</script>
This prints out