MDanz Posted September 2, 2009 Share Posted September 2, 2009 i'm having trouble with the drop down list. when i insert into mysql, its not inserting the drop down list selected. <form enctype='multipart/form-data' action='insert.php' method='post' name='changer'> <p align='center'> <input type='text' name='username'value='$username' readonly='readonly'> <br> <input type='text' name='hyperlink'value='input hyperlink here'> <br> <input type='text' name='name' value='input title here'> <br> <input type='text' name='summary' value='input summary here'> <br> <textarea name='info' cols='40' rows='10' wrap='hard'>input full detail here</textarea> <br> <font color=white>input keywords manually</font><input type='text' name='keywords' value=''><br> <font color=white> or </font> <select name 'keywords'> <option>--Select a category--</option> <option value='Debate'>Debate</option> <option value='Music'>Music</option> <option value='Jobs'>Jobs</option> </select> <input type='submit' name='submit' value='Submit'><br></p></form>"; i named the select name keywords... i thought it would insert but its not.. i have two inputs named 'keywords' the textfield and the dropdownlist..the textfield inputs into keywords fine when submitted. the dropdownlist doesn't insert into keywords.. $username = mysql_real_escape_string($_POST['username']); $hyperlink = mysql_real_escape_string($_POST['hyperlink']); $name = mysql_real_escape_string($_POST['name']); $summary = mysql_real_escape_string($_POST['summary']); $info = mysql_real_escape_string($_POST['info']); $keywords = mysql_real_escape_string($_POST['keywords']); // Create the query and insert // into our database. $query = "INSERT INTO Stacks"; $query .= "(`username`,`hyperlink`,`name`,`summary`,`info`,`keywords`) VALUES ('$username','$hyperlink','$name','$summary','$info','$keywords')"; Link to comment https://forums.phpfreaks.com/topic/172832-solved-form-problem-should-be-easy/ Share on other sites More sharing options...
sasa Posted September 2, 2009 Share Posted September 2, 2009 change <select name 'keywords'> to <select name='keywords'> Link to comment https://forums.phpfreaks.com/topic/172832-solved-form-problem-should-be-easy/#findComment-910904 Share on other sites More sharing options...
MDanz Posted September 2, 2009 Author Share Posted September 2, 2009 thx Link to comment https://forums.phpfreaks.com/topic/172832-solved-form-problem-should-be-easy/#findComment-910909 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.