# Problem with json.decode

**URL:** <https://forums.solar2d.com/t/problem-with-json-decode/351889>\
**Category:** Network\
**Created:** [July 22, 2020, 1:43pm UTC](https://forums.solar2d.com/t/problem-with-json-decode/351889 "2020-07-22T13:43:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![magnusbekkestua](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/m/22d042/32.png) [@magnusbekkestua](https://forums.solar2d.com/u/magnusbekkestua)\
**Post date:** [July 22, 2020, 1:43pm UTC](https://forums.solar2d.com/t/problem-with-json-decode/351889/1 "2020-07-22T13:43:48Z")

</div>

When I access my phpscript the output look like this:  
{“Text1”:[“1”,“1”,“2020-07-21”,“Testing”,“Magnus”]}

When I try to get it to my app something is wrong with the response from the server:  
From server: This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support

Here is the code in the main.lua:

```auto
local json = require ("json")
local decodedData 
local myNewData 

local function networkListener( event )
  if ( event.isError ) then
     print( "Network error!")
  else
     myNewData = event.response
     print ("From server: "..myNewData)
     decodedData = (json.decode( myNewData))
     print(decodedData)
  end
end

network.request( "http://maholmsoftware.epizy.com/get.php", "GET", networkListener )

```

Somebody have an idea what I should do?

(_Post edited by moderator; Please format code in posts using triple back-ticks to enclose code.; Click pencil icon to review changes and see how code was reformatted._)

---

<div class="post-metadata">

**Author:** ![XeduR](https://forums.solar2d.com/user_avatar/forums.solar2d.com/xedur/32/256_2.png) [@XeduR](https://forums.solar2d.com/u/XeduR)\
**Post date:** [July 22, 2020, 5:37pm UTC](https://forums.solar2d.com/t/problem-with-json-decode/351889/2 "2020-07-22T17:37:23Z")

</div>

There’s no issue with json.decode. Your issue is with your host, InfinityFree, which forbids what you are trying to accomplish, i.e. you can’t use their free hosting as a backend for your app.

> **[Ensuring only web browsers can access your website](https://support.infinityfree.net/websites/javascript-error-using-api-or-mobile-android-app/)**
>
> InfinityFree is a website hosting service. That means that the hosting accounts we provided are intended for hosting websites. Websites contains pages which are accessed through web browsers. InfinityFree is not intended to be used for file sharing,...

---

<div class="post-metadata">

**Author:** ![magnusbekkestua](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/m/22d042/32.png) [@magnusbekkestua](https://forums.solar2d.com/u/magnusbekkestua)\
**Post date:** [July 22, 2020, 8:03pm UTC](https://forums.solar2d.com/t/problem-with-json-decode/351889/3 "2020-07-22T20:03:01Z")

</div>

Thank you, thought I was gonna be crazy 🙂
