Get Object Works in Engine, but Not in HTML5 Runtime w/ Example

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I need to pull a value from PHP and it works fine with the GET Object in fusion, but when I build, it doesn't work.

    What's causing this and is there a way around it?

    I linked an example that shows this.

    Thank you

    Please login to see this attachment.

    Please login to see this link.

  • I need to pull a value from PHP and it works fine with the GET Object in fusion, but when I build, it doesn't work.

    What's causing this and is there a way around it?

    I linked an example that shows this.

    Thank you

    Please login to see this attachment.

    This isn't an issue with the Get object. It looks like it's an issue with the script you are executing on the server. The Cross-Origin request was blocked because the response data from the PHP script was missing the CORS header 'Access-Control-Allow-Origin'. You need to return this response header with your data so that the request isn't blocked. For example, the Newgrounds.io Gateway address (Please login to see this link.) returns some JSON data instead of rejecting the request because the gateway's PHP script has been set up to allow requests from remote origins. As long as you remember to have your script return that header with the rest of your response data, the GET request to that address from the Get object should work on the HTML5 runtime.

    Some more information on the 'Access-Control-Allow-Origin' header: Please login to see this link.

    Here's how to add that header to a PHP script: Please login to see this link.

  • Do I just add-

    header("Access-Control-Allow-Origin: *");

    Yes you should add that. Make sure that line is at the very top of the script before anything else. Like this:

    PHP
    <?php
    header("Access-Control-Allow-Origin: *");
    echo "YES"; 
    ?>

    I tested this exact code on my own site and can confirm that it works.

    Edited once, last by tobydavis (October 25, 2022 at 3:53 AM).

  • You should also post errors from console to have a better understanding,

    starting from this:

    Cookie “PHPSESSID” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read Please login to see this link.

    If you are planning to need this, it is very important to set up correctly.

    Then i played a little bit with your website and moving ahead i got another error


    GET Please login to see this link.
    [HTTP/1.1 404 Not Found 0ms]

    checking what it is happening in detail, see headers and answer

    GEThttp://Please login to see this link.
    [HTTP/1.1 404 Not Found 0ms]


    GET
    Please login to see this link.
    Status
    404
    Not Found
    VersionHTTP/1.1
    Transferred315 B (315 B size)
    Referrer Policystrict-origin-when-cross-origin


    HTTP/1.1 404 Not Found
    Date: Wed, 26 Oct 2022 14:27:14 GMT
    Server: Apache
    Content-Length: 315
    Keep-Alive: timeout=5, max=98
    Connection: Keep-Alive
    Content-Type: text/html; charset=iso-8859-1
    GET /favicon.ico HTTP/1.1
    Host: form1generator.com
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0
    Accept: image/avif,image/webp,*/*
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate
    Connection: keep-alive
    Referer: Please login to see this link.
    Cookie: PHPSESSID=1c1c3cc941cc7e741851e39e02a9beb2

    could it be that cookie not set correctly get this error

    Regards,


    Fernando Vivolo

    ... new things are coming ...

    Edited once, last by Fernando (October 26, 2022 at 3:37 PM).

  • What site can I go to for free hosting so I can test out this php script?
    Thanks

    I would really recommend that you use paid web hosting. The saying "you get what you pay for" also applies when you pay nothing. These free hosting sites always have some kind of limit. I'm currently hosting my zaptospark.com domain with a host called Please login to see this link. for $2.95 a month and haven't had any problems so far. If you're still set on free hosting though I do know of Please login to see this link. (who are owned by Hostinger) and Please login to see this link. (they were used for the PHP Please login to see this link. on Clickteam's Tutorial page). It looks like both of them support PHP on their free plans.

    Edited 2 times, last by tobydavis (October 26, 2022 at 3:54 PM).

  • Fixed!

    Thank you everyone.

    After adding the header, I could only get 1 of 4 values even though I was using 4 different get objects at the start of the frame. But regardless of the number of get objects it can only get 1 at a time. Doing them all at the start of the frame with "on get complete"; caused only 1 value to be recived and 1 or all my different fusion values to be set to the 1 get on complete.

    So I made a cycle to go through each value at a time, not moving on to the next till the last get value was complete.

    Noting this for future devs, it was simple, but a pain to figure out.

    Thanks to the both of you!

    Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!