...

View Full Version : Resolved Text Input, Not inputing



Feckie
10-15-2009, 08:43 PM
HELP!!!!

What am I doing wrong here

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




<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


<?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);
?>

Fumigator
10-15-2009, 08:47 PM
We'd have to see the other side of things to be of any help.

Feckie
10-15-2009, 08:50 PM
We'd have to see the other side of things to be of any help.

Updated sorry

CFMaBiSmAd
10-15-2009, 08:59 PM
This -


name="$Pack_Name"

Should be -


name="Pack_Name"

Feckie
10-15-2009, 09:06 PM
This -


name="$Pack_Name"

Should be -


name="Pack_Name"





Excellent That Works



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum