简体   繁体   中英

Unable to retrieve Json Information

Trying to retrieve a JSON array however the page is just echoing "Null"

Here is the code that I use to retrieve the Json Variable

    <?php
function getSystem($address)

    {

        $data_location = "/r10database/checkSystem/index.php?theaddress=".$address;
        $data = file_get_contents($data_location);


        $data = json_decode($data);

        $system = $data->system;

        var_dump($system);



    }
getSystem("Blvd");
?>

And here is my code to encode my json variable

function changeElement(contentString,address){


var addressObject = new Array();
addressObject[0]=contentString;

var json_str = JSON.stringify(addressObject); 
var obj = JSON.parse(json_str)

  $('#insertHere').html(json_str);

}

The remote API is broken.

http://pear.coreyjansen.com/r10database/checkSystem/index.php?theaddress=200%20Scurfield%20Blvd

Resource interpreted as Script but transferred with MIME type text/plain: "http://geoxml3.googlecode.com/svn/branches/polys/geoxml3.js". index.php:11
Uncaught SyntaxError: Unexpected token else index.php:116
Uncaught ReferenceError: initialize is not defined index.php?theaddress=200%20Scurfield%20Blvd:132

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM