AJAX object problem

0 favourites
  • 3 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hi,

    Im trying to sending data to server, it's very simple, only name and score. Im using AJAX object, and test it on localhost. But what happened is, its not working. It triggers onComplete event (for the AJAX) but the data never get into the database.

    i've tried manually the url in the browser, and it's work. But in one condition, on the .php file, im using $_GET instead of $_POST. If im using $_POST, either way doesnt work. it comes and error saying something about undefined index: error..

    Can someone give me hint about this problem and how to solve it ? Really appreciate it ! Thanks

  • Is it blocked by CORS? Have you set up Access-Control-Allow-Origin as described by the AJAX manual entry?

  • Try Construct 3

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

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

    Thank you for replying !

    I'm not so sure about that. But anyway, somehow, now it works. But with one condition; i'm not using URLEncode when passing the data on construct. whenever i used urlencode, it always shown an error saying that the variables on the PHP is empty, sql query is empty.

    Should i post something so to make it clear ?

    i'm quite confused and worried even if its works now, because it doesnt use URLEncode.. i hope you can get a clue about it ashley

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