mysql - Radio Button Value Submitted As ON instead of Value -
i'm dev noob.
i got mysql @ least start building database have recieved here! woot.
i aware prone injections , i'm using deprecated mysql right want radio value display male or female in db before deal sanitization. right gets db "on" regardless of gender checked. have looked @ lot of other threads on code abridged thought i'd ask. code:
<?php $con=mysqli_connect("localhost", "shiftedr_admin", "", "shiftedr_whosthedeeusers"); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $sql="insert users2 (fullname, email, password, gender) values ('$_post[fullname]','$_post[email]','$_post[password]', '$_post[gender]')"; if (!mysqli_query($con,$sql)) { die('error: ' . mysqli_error($con)); } echo "1 record added"; mysqli_close($con); ?> and html source is
<form method="post" name="accountcreation" id="accountcreation" action="insertnewaccounts.php" style="background-color:#ccffff;"> <center><h1 style="position:relative;left:0px;"> account creation </h1> <table> <tr> <td align="right"> full name: </td> <td align="left"><input type="text" id="fullname nameerror" name="fullname" min="4" class="spacing" placeholder="your full name"/> </td></tr> <tr> <td align="right">email</td> <td align="left"><input type="text" id="email" name="email" min="5" placeholder="@" /> </td></tr> <tr> <td align="right"> password </td> <td align="left"><input type="text" id="password" name="password" class="spacing" placeholder="minimum 6 characters"/> </td></tr> <tr> <td align="right"> confirm password </td> <td align="left"><input type="text" id="confirmpassword passworderror" class="spacing" name="pwc" placeholder="confirm password"/></td></tr> <tr> <td align="right"> owner's' gender: </td> <td align="left"><input type="radio" name="gender" value="male">male <input type="radio" name="gender" value="female">female </td></tr> </table> </dl> <input type="submit" value="check" /></center> </form> thanks guys! grateful help! -pat
Comments
Post a Comment