stilts77's Forum Posts

  • 11 posts
  • Hiya.

    Thanks for that... still doesn't post the user though...

  • Well, OK - I've been told! Thank you anyway!

    I've removed the ? and it now posts the 'score' into the database... but not the 'user'.

    It's clearly to do with the query string I'm sending but I can't see why.

    I've tried changing it to: "score="&score&"user="&user but that doesn't work either.

    Could I have one more piece of wisdom form you please? ;-)

  • Hehe.

    I've run the PHP outside of Construct. It works successfully.

    My problem is that I can't get Construct to make it happen!

  • Yes - it really is trivial! That's what is making it so frustrating!

  • Cheers. Will have a look. 😉

  • Eh?

    [je]Sub Header

  • I have created another html form and posted to the get.php

    It works.

    So... what does that mean in Construct?

  • I get that... but how do I trigger the php? I thought the OK click was triggering it... if it's not: how do I?

    I work with php regulary... but just can't get my head around how it is instigated from Construct!

    I know I look completely daft... but there we are!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can anyone see why this doesn't post anything to the URL?

    I click on the OK button... but nothing happens!

  • Thank you!

    What happens now is that the 'game' returns an 'All Done' update... but nothing is being added to the database...

    The get.php file isn't supposed to pop open in a browser is it? I'm a little unsure as to what is supposed to happen after the click on the OK button.

  • I've read several posts about sending data to a URL...

    ... but I can't seem to make it happen.

    Above is the Construct3 event sheet. I have this 'game' running online (it's not a preview).

    The php it is trying to connect with is:

    <?php if (isset($_GET['score'])){ $score=$_GET['score']; $user=$_GET['user']; include ('connect_db.php'); $sql=mysqli_query($con, "INSERT INTO construct3 (user,score) VALUES ('$user','$score')"); if($sql){ //The query returned true - now do whatever you like here. echo 'Your score was saved. Congrats!'; }else{ //The query returned false - you might want to put some sort of error reporting here. Even logging the error to a text file is fine. echo 'There was a problem saving your score. Please try again later.'; } }else{ echo 'Your name or score wasnt passed in the request. Make sure you add ?name=NAME_HERE&score=1337 to the tags.'; } mysqli_close($con); ?>

    Nothing happens when I click the OK button... I can't see why!

    Can anyone help please?

  • 11 posts