0 Favourites

AJAX object problem

  • 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?

  • Construct 3

    Buy Construct 3

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

    Buy 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)
Similar Topics Posts Views Last Post
Unread hot topic
167 14,517
DMT2005's avatar
DMT2005
Unread hot topic
123 14,876
Zebbi's avatar
Zebbi
Unread hot topic
98 7,602
norum82's avatar
norum82