Is it possible to hide name of *.php file in
$(document).ready(function(){
$.getJSON("getdata.php", function(returned_data) {
if(returned_data === "1") {
$("div#wall").html('user has no subscription');
$("#message_wall").attr("disabled", "disabled");
return false;
}
});
});
Because that jquery code will be visible in source code of the page and I do not want to some malicious visitors try to do something with it.
The short answer is no, you must secure this server-side. Anything a client can run, they can see...and anyone trying to be malicious can certainly figure out.
Even if you hid it under 15 layers of obfuscation, ultimately the browser still makes a request to a url, and any debugging tool can see that, FireBug, Fiddler, etc.
A session based approach, or cookies, something, anything to check that the user is authenticated/authorized on the server-end is the best approach.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With