Jump to content

[SOLVED] PHP changing my form input?


djfox

Recommended Posts

I have this section of a form made:

<b>Gender:</b>
<br><select name="gender" style="border: 0px; background-color:#000000; color: #B6ABCE;">
<option value="b">Both
<option value="f">Female
<option value="m">Male
</select>

 

Here`s the php section that the results of all of the fields in the form are sent to:

	$add="INSERT INTO clothing ( name, desc2, shortname, store, files, layers, gender, posespec, type, cost, spec, date ) VALUES ( '$title', '$des', '$short', '$region', '$filenames', '$lay', '$gender', '$pose', '$type', '$price','$spe', '$entry_date' )";
$res = mysql_query($add) or die(mysql_error());

 

When the field entry for gender is supposed to be is "b". But when the form is filled out and sent, the gender entry "b" is somehow changed to "B", which causes complications for several other pages. The "gender" field in the database table was set to char type and thinking that was why, I tried changing it to varchar. But the mysql doesn`t want to change it to varchar.

 

What should I do to keep the letter lowercase?

Link to comment
https://forums.phpfreaks.com/topic/83916-solved-php-changing-my-form-input/
Share on other sites

Ok, I got gender set to varchar (hoping that it would leave the input alone and not capitalize anything). Now the form sends "Both" instead of "b". (First post shows that the value to be sent should be just "b".) Strange I`ve never had such a problem with forms before. =P

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.