Problem with AJAX "post to url"

0 favourites
  • 4 posts
From the Asset Store
We present to you “Post Apocalyptic Trailer” – our newest hard hitting, bass rumbling designed movie trailer collection.
  • I need to send some data to my database. for that I use ajax and php, and "post to url".

    However, it is not sent and I do not know the reason, since I have done it in construct 2 without problems, but in construct 3 that changed and I don't know what the problem is.

    I have it complete as follows:

    TAG: "Send"

    URL: "https://domain.com/carpet/senddata.php"

    DATA: "name ="&varName&"mail="&varMail&"pass="&varPass

    METHOD: "POST"

    I also want to clarify that my php files are perfectly since I have tried it from another place and it works. The problem arises in construct3 ...

    Tagged:

  • This doesn't look right:

    DATA: "name ="&varName&"mail="&varMail&"pass="&varPass

    It will produce a string like this:

    "name =Johnmail=john1990@gmail.compass=qwe123"

    Try changing it to this:

    DATA: "name="&varName&"&mail="&varMail&"&pass="&varPass

  • Is that how it works.

    In construct 2 the syntax was different.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No, it's a mistake in your expression. Url parameters need to be separated by & character. Which needs to be inside the quotation marks.

    DATA: "name=" & varName & "&mail=" & varMail & "&pass=" & varPass

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