Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: Arcade Question

  1. #1
    New Coder
    Join Date
    Mar 2011
    Posts
    57
    Thanks
    5
    Thanked 3 Times in 3 Posts

    Arcade Question

    I have an arcade... and I call the game names from the db, I want to be able to take a game name, if I click on a button/link and inject it into my html flash player. thanks


    PHP Code:



    mysql_selectdb
    ("jaarcade_games",$con);

    $result mysql_query("SELECT * FROM games") or die("Query failed with error: ".mysql_error());

    while(
    $row mysql_fetch_array($result))
      {
    something something
      
    }

    ?> 
    Last edited by x34cha; 03-11-2011 at 10:38 PM.

  • #2
    New Coder
    Join Date
    Mar 2011
    Posts
    57
    Thanks
    5
    Thanked 3 Times in 3 Posts
    nobody knows?

  • #3
    Super Moderator
    Join Date
    Feb 2009
    Location
    England
    Posts
    539
    Thanks
    8
    Thanked 63 Times in 54 Posts
    Please don't bump your posts.

    Since $row will contain relevant information from your database, you can echo() out the code to insert the flash player, and include the information from $row within that.
    lamped.co.uk :: Design, Development & Hosting
    marcgray.co.uk :: Technical blog

  • #4
    New Coder
    Join Date
    Mar 2011
    Posts
    57
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by Lamped View Post
    Please don't bump your posts.

    Since $row will contain relevant information from your database, you can echo() out the code to insert the flash player, and include the information from $row within that.
    Right but that would be for a specific game right?

    I want a user to be able to click on any of my games, and the name inject into the flash player, through GET/POST???

  • #5
    Super Moderator
    Join Date
    Feb 2009
    Location
    England
    Posts
    539
    Thanks
    8
    Thanked 63 Times in 54 Posts
    I don't know, you haven't been very specific. Maybe with more information, we could be more helpful.
    lamped.co.uk :: Design, Development & Hosting
    marcgray.co.uk :: Technical blog

  • #6
    New Coder
    Join Date
    Mar 2011
    Posts
    57
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by Lamped View Post
    I don't know, you haven't been very specific. Maybe with more information, we could be more helpful.
    Ok, so I have called 5 game names from a database and I want to be in any way possible to inject say "blabla.swf" into my flash player in another file or on the same page, when they click on one of the submit buttons for each game, i want the name of that game to go into my flash player.

  • #7
    New Coder
    Join Date
    Mar 2011
    Posts
    57
    Thanks
    5
    Thanked 3 Times in 3 Posts
    I did it.. code.. if anybody is interested...

    PHP Code:
    <?php

    $con 
    mysql_connect("","","");

    mysql_selectdb("jaarcade_games",$con);

    $result mysql_query("SELECT * FROM games") or die("Query failed with error: ".mysql_error());

    while(
    $row mysql_fetch_array($result))
      {
     
    $game $row["game_name"];
      echo 
    '<a href="/arcade2.php?game=' .$game'"> ' .$game'</a>';
     }

    ?>
    Last edited by x34cha; 03-11-2011 at 11:41 PM.

  • #8
    Super Moderator
    Join Date
    Feb 2009
    Location
    England
    Posts
    539
    Thanks
    8
    Thanked 63 Times in 54 Posts
    So that first page sets the name. You might want to use:

    PHP Code:
    echo('<input type="hidden" name="game_name" value="'.$row['game_name'].'" />'); 
    Then in the next page, when displaying the swfobject code, <embed> or <object>, use:

    PHP Code:
    echo($_POST['game_name']); 
    in place of your swf file.
    lamped.co.uk :: Design, Development & Hosting
    marcgray.co.uk :: Technical blog


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •