b781rev's Forum Posts

  • Here are some AJAX examples. One is to save and load from a database and if you go to that one, make sure you hit L first to load the data.

    This one:

    peepelz.com/index.php

    will let you register to my site via AJAX.

    It's pretty cool stuff

  • Oh, I know. I just posted it as an example. I won't be running my site with queries like that.

  • Did anyone find these examples useful?

  • Ok, I'm going to post what I have for my .capx for the saving variables to a database and the php for it.

    FILE:

    4shared.com/file/885mRUrE/ajaxsave.html

    PHP:

    <?php

    include('connect.php');

    if ($_GET['mode']=="save") {

    $score = $_GET['score'];

    $level = $_GET['level'];

    mysql_select_db("p668534r_members", $con);

    mysql_query("UPDATE ajax SET ajax_score = '$score', ajax_level = '$level'

    WHERE username = 'b781rev'");

    if (!mysql_query($sql,$con))

    { die('Error: ' . mysql_error()); }

    mysql_close($con);

    }

    if ($_GET['mode']=="load") {

    mysql_select_db("p668534r_members", $con);

    $result = mysql_query("SELECT * FROM ajax WHERE username='b781rev'");

    while($row = mysql_fetch_array($result))

    {

    echo $row['ajax_score']."|".$row['ajax_level']."|";

    }

    mysql_close($con);

    }

    ?>

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, here is the .capx:

    4shared.com/file/6glBPu19/login.html

    jax.php:

    <?php

    $username=$_GET['username'];

    $password=$_GET['password'];

    echo $username."\n".$password;

    ?>

    Or whatever you need to put in your php page to login. Of course, that is not all of it.

    ?>

  • Ok, I just gone done downloading the newest version and I was playing around with the input boxes and buttons. I made a program where you can login an account via AJAX with the forms on the game. I don't know if it's the most secure way to do it but it's just the point of it. It's awesome.

  • So why would you want it to collapse on a key event? Wouldn't you want them to collapse whenever the player walks over them or something?

  • Online demo working:

    peepelz.com/wish.php

    This is saving and loading from a database using one string.

  • Well, I'm currently working on an AJAX project. On the php side it's nothing but php, no html. The bug thing could be that you are not focused on the canvas when you refresh but it could somehow focus it when you move your mouse.

    If you want, check out this forum topic for AJAX requests:

    scirra.com/forum/how-do-i-pull-variables-from-a-php-page_topic45040.html

    The file I'm currently working on:

    4shared.com/file/lPCGszyi/AJAX.html

    You might need to read the posts to get all the information from it so you can understand the php part.

  • I have successfully made a example where I can save and load data via AJAX without a lot of events. I will be posting my results as soon as I have everything organised the way I want them.

  • Try changing your php page to something simple like this:

    <?php

    echo "hello world";

    ?>

    And see if what that does. Are you using your own server or is it online?

  • Sorry about that I uploaded the wrong file:

    4shared.com/file/lPCGszyi/AJAX.html

  • Ok, here is a working example:

    edit: 4shared.com/file/lPCGszyi/AJAX.html

    jax.php contains the following:

    <?php

    echo "23|33|45|9900|27|77|".

    ?>

    Replace the period with a semicolon. Hope it works for you.

  • I wasn't worried about the php part, I can do that. I was just talking about the construct part. And the link for that example is not working. All I'm getting is a blank page.

    I don't have any PMs, and I can send them either. I don't have enough rep.

    And I'm working on the colors and font for my website. Haven't decided what I want to go with yet.

    edit: The link did workl

  • What are you getting syntax errors from?