0

i have 2 separate host on web , and i use same code in both , and both encode json for me in php .

but one of them in just keep saying this , in my android app :

This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support

how could i get rid of this get rid of ? why its only in one of my host ?

php code is :

<?php

$servername = "sql301.gigfa.com";
$username = "****"; 
$password = "****";
$dbname = "gigfa_18832988_tamrin";

$con = mysqli_connect($servername,$username,$password,$dbname);


$sql = "SELECT * FROM t;";



$result = mysqli_query($con,$sql);

$response=array();
while($row=mysqli_fetch_array($result))
{
    array_push($response,array("Week"=>$row[0],"Exercise"=>$row[1]));
}
echo json_encode(array("server_response"=>$response));

mysqli_close($con);

?>
  • Check the JS files you're including? – James Lalor Sep 06 '16 at 08:52
  • 5
    Whatever it is its nothing to do with this PHP code – RiggsFolly Sep 06 '16 at 08:54
  • 1
    it's looks like browser problem, not php. Check setting of browser and enable javascript there (i don't have much idea about that) – Alive to die - Anant Sep 06 '16 at 08:54
  • Try to set the correct header (application/json) while returning the json from PHP. See this stackoverflow answer http://stackoverflow.com/a/31522940/688924 It has more descriptive answer as well. Still if you face problem then please let us know how are you retrieving the json output in the client side. It looks like you are trying to use webview. Can't help much until we have more idea on your server, clients. – Samundra Sep 06 '16 at 09:04

0 Answers0