I'm creating an open source API using php and allowing the public to use it via jQuery AJAX GET.
I just need to know how I can make this secure.
For example, the users can call my php api on my server using jquery ajax like this:
var url = "http://mywebsite.com/api.php";
var variable = $("#variable").val();
$.ajax({
type: "GET",
url: url,
data: 'variable='+variable,
cache: false,
success: function(data){
$("#resultarea").html('' + data + '');
}
});
is there anything I need to do/Know for securing this API before presenting it to the public?
Any advise would be appreciated.