html - Textarea returns empty value in PHP POST -
i facing problem in textarea content post via php. have form submits 2 values 1 in textarea , other radio button. while submitting radio button value posted textarea value showed empty.
why happening? suggestion appreciated..
my snippet of html code
<form action="" method="post" id="register_form"> <h2><img class="small_image" src="images/rsz_heart.png">describe  yourself<img class="small_image" src="images/heart.png"></h2> <table id="register_table"> <tr> <td>describe yourself</td> <td> <textarea id="description" type="textarea" name="description" rows="5"  cols="40" class="textbox" form="register_form" required>type</textarea> </td> </tr> <tr> <td>any disability</td> <td> <input type="radio" name="disability" value="none" selected="selected">none <input type="radio" name="disability" value="physicaldisability">physical  disability </td> </tr> <tr> <td colspan=2> <input type="submit" name="submit" value="submit" class="button" > </td> </tr> </table> </form> my php code is
if(isset($_request["submit"])) {   $description = $_post["description"]; $disability = $_post["disability"]; $email = $_get["email"]; $sql = "update registration_members set description_self='$description',  disability='$disability' email='$email'"; $res = mysql_query($sql); if($res) { ?> <script> alert("you have registered successfully!!"); </script> <? echo $description." description"; echo $disability." disability"; } } ?> in output writes
 description none disability 
some edits code may solve problem:
1) use <?php  starting php tag. have used <? @ 1 place in code. change that.
2) change isset($_request["submit"]) isset($_post["submit"])
3) remove type="textarea" <textarea>
4) careful while opening , closing php tags. in case, have closed php tag after if(isset($_request["submit"])) { wrong. 
Comments
Post a Comment