How do I send info to a JSON file on server?

0 favourites
  • 3 posts
From the Asset Store
Create your own wss server and ws server with ssl and without ssl.
  • I have on my server a parent html files containing 2 child html files embedded with iframe. The idea is that one of the frames (containing animations) need to retrieve some data/variables from the other one (control panel) or from the parent html file, and I decided to use a JSON file. (all files are on the same domain/server)

    Using AJAX.RequestURL I CAN read the JSON (using relative path) but when it comes to write back to JSON I'm stuck.

    I have no idea how to use AJAX or PHP and I thought that sending the data to the url of the JSON file will modify it, but that is just silly thinking, I admit:)

    Is there a way to do this without using PHP or other complex things outside C2 ?

    I am doing this for someone that has no idea of C2 and he wants to modify the behavior of an animation on his own, from outside the animation html.

    Here is what I'm talking about if I did not explained properly:

    http://synapse1one.com/tests/rainwater_temp/index_2_iframes.html

    and this is the capx for the right-hand side frame https://dl.dropboxusercontent.com/u/139926126/Forums/scirra/test_JSON.capx

    Please, if anyone is having any ideas ,any suggestions are welcome.

    I don't expect for someone else to do it for me but to give me a hint

    Thanks guys

  • no, you can't ... a json file is just a simple text file with content. Being able to make changes to the file on the server would mean that you have a very big security issue (everyone would be able to just access it and make changes, even outside of your app).

    I'm sorry to tell, but you will need a PHP, Perl, ASP, ... Script in order to make changes on server hosted files.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ubivis That is a bad news. I will see what I can do eventually, Thanks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)