Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-15-2009, 08:43 PM   PM User | #1
Feckie
Regular Coder

 
Join Date: Jan 2009
Posts: 196
Thanks: 29
Thanked 0 Times in 0 Posts
Feckie has a little shameless behaviour in the past
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..
Feckie is offline   Reply With Quote
Old 10-15-2009, 08:47 PM   PM User | #2
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,687
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
We'd have to see the other side of things to be of any help.
__________________
Fumigator is offline   Reply With Quote
Old 10-15-2009, 08:50 PM   PM User | #3
Feckie
Regular Coder

 
Join Date: Jan 2009
Posts: 196
Thanks: 29
Thanked 0 Times in 0 Posts
Feckie has a little shameless behaviour in the past
Quote:
Originally Posted by Fumigator View Post
We'd have to see the other side of things to be of any help.
Updated sorry
Feckie is offline   Reply With Quote
Old 10-15-2009, 08:59 PM   PM User | #4
CFMaBiSmAd
Senior Coder

 
CFMaBiSmAd's Avatar
 
Join Date: Oct 2006
Location: Denver, Colorado USA
Posts: 2,744
Thanks: 2
Thanked 256 Times in 248 Posts
CFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the rough
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.
CFMaBiSmAd is offline   Reply With Quote
Old 10-15-2009, 09:06 PM   PM User | #5
Feckie
Regular Coder

 
Join Date: Jan 2009
Posts: 196
Thanks: 29
Thanked 0 Times in 0 Posts
Feckie has a little shameless behaviour in the past
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..
Feckie is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:18 PM.


Advertisement
Log in to turn off these ads.