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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jan 2009
    Posts
    204
    Thanks
    29
    Thanked 0 Times in 0 Posts

    Text Input, Not inputing

    HELP!!!!

    What am I doing wrong here

    All in Black inputs perfectly, but the Red does not... It just inputs a " 0 "


    Code:
    <form action="insert.php" method="post" NAME="Entry_Form">
    
    <p>From:.. <select name="Game From" size="1">
        <option selected value="">please Select</option>
        <option type=text name="$Game_From"  value="wolf">wolf</option>
        <option type=text name="$Game_From"  value="cads">cads</option>
        <option type=text name="$Game_From"  value="Here">Here</option>
        <option type=text name="$Game_From"  value="There">There</option>
    </select></p>
    
    <p>Name: <input type="text" name="$Pack_Name" /> </p>
    
    <p>Cat:....  <select name="Game Category" size="1">
        <option selected value="">please Select</option>
        <option type=text name="$Game_Category"  value="Adventure">Adventure</option>
        <option type=text name="$Game_Category"  value="Sports">Sports</option>
        <option type=text name="$Game_Category"  value="3">3</option>
        <option type=text name="$Game_Category"  value="4">4</option>
        <option type=text name="$Game_Category"  value="5">5</option>
        <option type=text name="$Game_Category"  value="6">6</option>
        <option type=text name="$Game_Category"  value="7">7</option>
    </select></p>
     <input type="submit" value="Submit" name="Submit" style="font-weight:bold; color:red;">
    </form>

    insert.php
    Code:
    <?php
    $con = mysql_connect("localhost","root","root");if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    mysql_select_db("games", $con);
    
    
    
    
    $sql="INSERT INTO game_data (Game_From, Pack_Name, Game_Category) VALUES ('$_POST[Game_From]', '$_POST[Pack_Name]', '$_POST[Game_Category]')";
    if (!mysql_query($sql,$con)) {
     die('Error: ' . mysql_error());
    }
    echo "Added to your database....";
    
    mysql_close($con);
    ?>
    Last edited by Feckie; 10-15-2009 at 09:16 PM.

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    We'd have to see the other side of things to be of any help.

  • #3
    Regular Coder
    Join Date
    Jan 2009
    Posts
    204
    Thanks
    29
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fumigator View Post
    We'd have to see the other side of things to be of any help.
    Updated sorry

  • #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,049
    Thanks
    2
    Thanked 317 Times in 309 Posts
    This -

    Code:
    name="$Pack_Name"
    Should be -

    Code:
    name="Pack_Name"
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #5
    Regular Coder
    Join Date
    Jan 2009
    Posts
    204
    Thanks
    29
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by CFMaBiSmAd View Post
    This -

    Code:
    name="$Pack_Name"
    Should be -

    Code:
    name="Pack_Name"




    Excellent That Works
    Last edited by Feckie; 10-15-2009 at 09:15 PM.


  •  

    Posting Permissions

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