I try to learn basic PHP to connect between my server and android but I have a problem with my basic PHP it return html instead JSON.
this is my PHP code:
<?php
mysql_connect("sql100.0fees.us","*********","*******");
mysql_select_db("db shlomi");
$sql=mysql_query("select * from pru");
$output=array();
while($row=mysql_fetch_assoc($sql)) {
$output[]= array(
'name' => $row['name'],
'quantity' => $row['quantity']);
}
echo(json_encode($output));
mysql_close();
?>
when I run this in my browser I receive [{"name":"10","quantity":"50"},{"name":"10","quantity":"50"}]
but in my app or in jsonlint.com I receive error like html
<html><body><scripttype="text/javascript"src="/aes.js"></script><script>functiontoNumbers(d){
vare=[
];d.replace(/(..)/g,
function(d){
e.push(parseInt(d,
16))
});returne
}functiontoHex(){
for(vard=[
],
d=1==arguments.length&&arguments[
0
].constructor==Array?arguments[
0
]: arguments,
e="",
f=0;f<d.length;f++)e+=(16>d[
f
]?"0": "")+d[
f
].toString(16);returne.toLowerCase()
}vara=toNumbers("f655ba9d09a112d4968c63579db590b4"),
b=toNumbers("98344c2eee86c3994890592585b49f80"),
c=toNumbers("68c0fc9ff46cfabf092145e84011ee13");document.cookie="__test="+toHex(slowAES.decrypt(c,
2,
a,
b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/";location.href="http://ranva.0fees.us/query.php?ckattempt=1";</script><noscript>ThissiterequiresJavascripttowork,
pleaseenableJavascriptinyourbrowseroruseabrowserwithJavascriptsupport</noscript></body></html>
so I understand that my problem is in the PHP because it didn't return JSON.