API Request

I’m building a mobile app and I need online information so I created PHP code that returns some JSON data but when I try to request an AJAX post it gives me an error: <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("746113246d3904f01a5b6b0f818b230b");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="http://mouhamad-hamadani.epizy.com/phonegap/Example1/libs/Request.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>

so what should I do to receive the JSON data from the infityfree server

HI

https://infinityfree.net/support/javascript-error-using-api-or-mobile-android-app/

so it is impossible to make a web API here?

is there any other free web hosting that can let me do an API

free also means limited
but if this meets your needs you can try it

spam1

spam1=AboutObjects

I need a sever to put my PHP code on it so I can make a request on it from an mobile app

I understood
you need REST (get, post, put, delete)

yes