Need help with the "Get Object" function in HTML5

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 have a mental error somewhere.
    I want to send two fixed variable values to a (already finished and functional) PHP script.
    However, the data does not arrive at the PHP script.

    Definition in fusion:
    : ADD Post Data "x1" = "1"
    : ADD Post Data "x2" = "2"
    Get Url "https:// www. Homepagename .com / scriptname.php"
    (Spaces are intentionally inserted.)

    I just can't figure out where my fault might be. Can anyone help?

  • Get Object can only be running from web server if you are planning to make a post request this is a security concept used in HTML5

    be sure that your web server allow you to make post, check CORS
    most important here

    Please login to see this link.

    the 2 first lines

    and for your PHP

    Please login to see this link.

    Regards,


    Fernando Vivolo

    ... new things are coming ...

  • That's probably true.

    At the moment I am trying to integrate the app into my framework. When I call up the app using the standard file (created by Fusion) on my server, everything works without problems. However, if I integrate them into the framework, nothing will be displayed.

    I will probably have to work with iframes after all. ;o)

    Edited 2 times, last by fredMan (January 3, 2018 at 10:01 AM).

  • If someone should have the same problems, below is the solution for my problem.

    Apache CORS / .htaccess
    <IfModule mod_headers.c>
    Header add Access-Control-Allow-Origin "*"
    Header add Access-Control-Allow-Methods: "GET,POST"
    Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
    </IfModule>

    PHP side variable reception does not work with $_GET:
    $variable01 = $_POST['variable01'];
    $variable02 = $_POST['variable02'];

    Sometimes the simplest things are the hardest to solve.

    Best regards

  • Apologies to revive an old thread but I've also just run into this issue and I don't have authorisation to modify the server where the API is I require data from. My solution was to run the API call direct from the PHP script and echo the response. I can then 'get' the response using the get object, here is the PHP code:

    $url = 'Please login to see this link. to your api';
    $headers = array('Content-Type: application/json');

    $body = '{
    "parameter01": 11,
    "parameter02": "200",
    "parameter03": "ACC",
    "parameter04": 1
    }';

    $ch = curl_init($url);

    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $response = curl_exec($ch);

    if ($response === false) {
    die('Error occurred:' . curl_error($ch));
    }

    curl_close($ch);

    // echo response from the server. Tested and works using the get object to retreive the response run from a html page
    echo $response;

    So yes, in this case instead of trying to access an API directly, my approach was to access the API via the php script and echo the response so the get object can grab it. It seemed to work for me at least! 👍🏻

Participate now!

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