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 7 of 7

Thread: Help Me Please

  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Help Me Please

    i am starting a gaming website and i am having a bit of a problem with them here is my first pahe index.php
    PHP Code:
    <html>
    <head><title>Web Database Sample Index</title>
    </head> 

    <body bgcolor=#ffffff>
    <h1>Data from tabletest</h1>
    <?
        mysql_connect
    ("localhost""*****""*****");
        
    $query "SELECT GameName,
    Sub_date,
    Dev_email,
    Stage,
    Genre,
    Client,
    Platform,
    Interface,
    Multiplayer,
    Prizes,
    Last_reviewed,Cost,
    ESRBRating,
    Game_URL FROM gameform"
    ;
        
    $result mysql_db_query("*****"$query); 

        if (
    $result) {
            echo 
    "Found these entries in the database:<ul>";
            while (
    $r mysql_fetch_array($result)) {
                
    $GameName $r["Game Name"];
    $Sub_date $r["Submission Date"];
    $Dev_email $r["Developers Email"];
    $Stage $r["Development Stage"];
    $Genre $r["Game Genre"];
    $Client $r["Client"];
    $Platform $r["Platform"];
    $Interface $r["Interface"];
    $Multiplayer $r["Multiplayer"];
    $Prizes $r["Prizes"];
    $Last_reviewed $r["Last Reviewed"];
    $Cost $r["Game Cost"];
    $ESRBRating $r["ESRBRating"];
    $Game_URL $r["Game URL"];
                echo 
    "<li>$GameName, 
    $Sub_date, 
    $Dev_email, 
    $Stage, $Genre, 
    $Client, 
    $Platform, 
    $Interface, 
    $Multiplayer, 
    $Prizes, $Last_reviewed, 
    $Cost, 
    $ESRBRating, 
    $Game_URL"
    ;
            }
            echo 
    "</ul>";
        } else {
            echo 
    "No data.";
        }
        
    mysql_free_result($result);
    ?>

    <form name="form1" method="post" action="add_new_game.php">
      <input type="submit" name="Submit" value="Add A New Game">
    </form>
    <p>&nbsp; 
    </body>
    </html>
    Last edited by The69Pimp; 07-01-2002 at 08:42 PM.

  • #2
    New Coder
    Join Date
    Jun 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    and.....

    here is the second page were they fillin the game info
    PHP Code:
    <html>
    <head><title>Submitting New Game</title>
    </head> 

    <body bgcolor=#ffffff>
    <?
        
    if (isset($GameName
    && isset(
    $Sub_date
    && isset(
    $Dev_email
    && isset(
    $Stage
    && isset(
    $Genre
    && isset(
    $Client
    && isset(
    $Platform
    && isset(
    $Interface
    && isset(
    $Multiplayer
    && isset(
    $Prizes
    && isset(
    $Last_reviewed
    && isset(
    $Cost
    && isset(
    $ESRBRating
    && isset(
    $Game_URL)) {
        
    mysql_connect("localhost""*****""*****"); 
            
    $query "INSERT INTO gameform VALUES 
    ('$GameName',
    '$Sub_date',
    '$Dev_email',
    '$Stage',
    '$Genre',
    '$Client',
    '$Platform',
    '$Interface',
    '$Multiplayer',
    '$Prizes',
    '$Last_reviewed',
    '$Cost',
    '$ESRBRating',
    '$Game_URL')"
    ;
            
    $result mysql_db_query("*****"$query); 

        if (
    $result) {
            echo 
    "<p>$name was added to the database</p>";
        }
    }
    ?>

    <h1>Add an entry</h1>
    <form>
    Game Name: <input type=text name='GameName'><br>
    Submission Date: <input type=text name='Sub_date'><br>
    Developers Email: <input type=text name='Dev_email'><br>
    Development Stage: <input type=text name='Stage'><br>
    Game Genre: <input type=text name='Genre'><br>
    Client Type: <input type=text name='Client'><br>
    Platform: <input type=text name='Platform'><br>
    Interface: <input type=text name='Interface'><br>
    Multiplayer: <input type=text name='Multiplayer'><br>
    Prizes: <input type=text name='Prizes'><br>
    Last Reviewed: <input type=text name='Last_reviewed'><br>
    Cost: <input type=text name='Cost'><br>
    ESRBRating: <input type=text name='ESRBRating'><br>
    Game URL: <input type=text name='Game_URL'><br>
    <input type=submit>
    </form>

    <form name="form2" method="post" action="index.php">
      <input type="submit" name="Submit" value="Return To Index">
    </form>
    </body>
    </html>
    and all it does when i click submit is it puts the info into the address bar please help me
    Last edited by The69Pimp; 07-01-2002 at 08:46 PM.

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Which submit button?
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #4
    New Coder
    Join Date
    Jun 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the submit button after i fill in the info for the game

  • #5
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    This submit button?

    <input type="submit" name="Submit" value="Add A New Game">
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #6
    New Coder
    Join Date
    Jun 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no the submit button got left out i belive the submit button it but here it is

    PHP Code:
    <input type=submit
    that is in there i am new to php and mysql so i have no clue what to do to get it working

  • #7
    Regular Coder
    Join Date
    May 2002
    Location
    London, England
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Its because you haven't specified a form method. change

    <form>

    to

    <form name="form" method="post" action="wherever.php">

    Jee
    Jeewhizz - MySQL Moderator
    http://www.sitehq.co.uk
    PHP and MySQL Hosting


  •  

    Posting Permissions

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