I need to access this php with JavaScript. I have this php with secure access by so many ways: only for my own ip, only for my domain, direct access not allowed, secured by htaccess an we know so many other ways to secure this.
And now i have this JavaScript, then you can access this JavaScript and get data from my database. And you can do it like a monster... you can put a bot to send #input1 and get all my data.
I tried to find a solution for more than 14 hours, and read many posts, sites but no luck. NO Way. OHHH MY GOD, is this possible?
Here a part of my code: JavaScript
$.getScript("http://www.domain.com/getdata.php?data="+$("#input1").val(), function(){
if (resultData["field2"] != '') {
$("#input2").val(unescape(resultData["field2"]));
$("#input3").val(unescape(resultData["field3"]));
}
});
And PHP
header('content-type: application/json; charset: utf-8');
// here my get mysql connection and query.... where field1 = #input1
if ($row = mysql_fetch_assoc($res)) {
echo "var resultData = {
'field2' : '" . $row['field2'] . "',
'field3' : '" . $row['field3'] . "',
}";
}
I don't believe we have no solution for this! Lost my day by trying to protect this!
I need to protect this only for who is browsing my website, o maybe per domain, or per requests =/
No Way!
htaccessor else) should solve your issue, shouldn't it?