Not displaying JSON content

Hello,

I have a simple php script that outputs a json.
http://slricaforte.ezyro.com/sample_json.php

When I access it directly using a browser, it outputs it this way:

{"key1":"value1","key2":"value2","key3":"value3"}

But when I send an AJAX request from a mobile or ripple plugin, I get this output:

<html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],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);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("bb7ed747266cf853bb8d5f7aec172cff");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="http://slricaforte.ezyro.com/sample_json.php?i=1";</script><noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html>

I've read here that is some hosting server have some kind of SPAM Shield that auto-blocks "strange access" to server. Is this also the case here?

This is a really serious problem for me. Please help.

Comments

  • lionlancer
    edited November -1

    Hello.

    The url is the actual URL because the file is hosted at ProFreeHost. I need to access the actual url when requesting via ajax since the request is from the mobile app.

    It's weird the link redirects you to a different page. Here's the actual link: https://wordpress.org/support/topic/it-looks-like-this-is-a-web-page-not-a-feed-i-looked-for-a-feed-associated/

    I don't think I have any error because I just simply echoed a json encoded array. Here's the script:

    <?php
    
    header("Access-Control-Allow-Origin: *");
    header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    
    echo json_encode(array(
    "key1" => "value1",
    "key2" => "value2",
    "key3" => "value3",
    ));
    
    ?>
    

    I hope this helps.

    Thank you.