vinsky2007's Forum Posts

  • Hi,

    Yes, i made the changes on my localhost and it is working even if the said Error from console is there.

    I am also trying to Request data off the server-side the PHP script is below (for return-msg.php):

    <?php

    header('Access-Control-Allow-Origin');

    echo "This is a Return value from an AJAX call...";

    ?>

    I have added the lines below in the Project file (sorry, i have not uploaded an updated copy yet but i will as soon as i have a chance too).

    AJAX

    Request "http://localhost/testing-only/return-msg.php"

    Tag

    "GetData"

    Then, I added

    AJAX

    on "GetData" completed

    returnText (text)

    Set text to AJAX.LastData

    However; i am not able to receive the said Echo'd string message.

    Please advise and Thank You again for the much support.

    Is there a list of updated Tutorials that i can work with ?

    Thank You very much again for the much support.

    I like the product very much and will be getting my own copy soon, i just wanted to know more about the said product as i am an urgent little game that i wanted to work on and needed to know more about the data handling side.

    Kind regards.

    Vins

  • Hi,

    I have just corrected and uploaded a new version where I have removed the "?".

    However; i am getting a " Refused to set unsafe header "Content-Length " when I use the Developer Tools -> Console.

    Please advise as i am still writing blanks.

    Thank You very much.

    Vins

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    Sorry, the said file can be downloaded in the link below (just uploaded).

    leiron.be/exttopics3/test/input-form-ajax.capx

    The PHP code is below (from the file record-msg.php):

    <?php

    /**

    * AUTHOR Vinson Tan

    * 2013

    */

       session_start();

       

       $vin = "../connect.php";

       if ( file_exists( $vin )) {

          require( $vin );

       } else {

           $vin = "connect.php";

           if ( file_exists( $vin )) {

              require( $vin );

           } else {

                $vin = "../../connect.php";

                if ( file_exists( $vin )) {

                   require( $vin );

                } else {

                      $vin = "../../../connect.php";

                      if ( file_exists( $vin )) {

                         require( $vin );

                      } else { echo "Sorry, $vin was not found  "; }

                   }

            }

         }

       

       $fname = $_GET['fname'];

       $fmsg = $_GET['fmsg'];

       

       $sqlstr = "insert into construct_user_list (playerid, msg) values ('".

                  $fname.

                 "','".

                  $fmsg.

                 "')";

       

       mysql_query( $sqlstr );

       

       mysql_close($conn);

       

    ?>

    Thank You.

    Vins

  • Hi,

    I am very very New with Construct 2 and I have just tried to work with AJAX POST but it seems that it is sending blanks as The Parameters (data) is not being send into the PHP scripts.

    Which means, I am writing Blanks into the MySQL table i setup just for that.

    Please help as i just followed the Tutorial.

    Thank You.

    Vins

  • Link to .capx file (required!):

    leiron.be/exttopics3/test

    Steps to reproduce:

    1. vinsky2007lqt@gmail.com

    2.

    3.

    Observed result:

    Sending the data via AJAX POST the parameter is not able to send to the PHP script to save the parameter passed which are taken from Input Form, but it is writing blank which means the parameter (data) was not send.

    I followed the sample.   Yes, database table had been created and connection is valid but it is writing blank.

    Expected result:

    Insert parameter passed which was a Name and a Message (text) field into the Table with the values in it

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Windows 7 Starter

    Construct 2 version:

        

    version r127