I am using this code for facebook like callback:
<script type="text/javascript">
FB.Event.subscribe('edge.create', function(response) {
// php script to call via ajax
});
</script>
The problem is that if i call a php script (for example http://www.test.com/addfacebook?id=xx&user=xxx&code=xxxx) someone can see my javascript and run this page and even spam it or use it without have liked first.
The concept is that i want to give a unique special discount code to every user likes the page. So on callback I want to store in database and id, the user real name from facebook and the discount code I created for him.
How to do it so someone can't override it (as it is javascript)?
Thanks a lot!