atticus Posted November 14, 2007 Share Posted November 14, 2007 When I hit the submit button, it enters information from the second two fields, but does not display the first field, which is <select> input. It displays the information from the database in the form and submits fine with no errors. if(isset($_POST['add'])) { $username = $_POST['username']; $title = $_POST['title']; $video = $_POST['video']; $query = "INSERT INTO upload2 (cust_id, video_title, video) VALUES ('$username', '$title', '$video');"; mysql_query($query) or die('Error, insert query failed' . mysql_error()); echo "<b>Thank you! Video Added Successfully!<br />You will be redirected in 4 seconds"; echo "<meta http-equiv=Refresh content=4;url=index.php>"; } else { ?> <form method="post" action="<?php echo $PHP_SELF ?>"> <select name="username" id="username"> <?php $sql = "SELECT * FROM cust"; $query = mysql_query($sql); while($myrow = mysql_fetch_array($query)) { echo "<option>".$myrow['cust_id']."</option>"; } ?> </select><br /> Title: <input type="text" name="title" id="title"><br /> Video: <textarea name="video">Paste Embed Code Here</textarea><br /> <input name="add" type="submit" id="add" value="Add Video"></td> <?php } ?> Link to comment https://forums.phpfreaks.com/topic/77399-solved-problem-with-options-on-form/ Share on other sites More sharing options...
Daukan Posted November 14, 2007 Share Posted November 14, 2007 It works for me. I put my own option in for testing and echoed the query and it was there. You should really use mysql_real_escape_string on post, get or cookies values. Link to comment https://forums.phpfreaks.com/topic/77399-solved-problem-with-options-on-form/#findComment-391808 Share on other sites More sharing options...
atticus Posted November 15, 2007 Author Share Posted November 15, 2007 your right, CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE CLEAN CACHE...maybe I'll remember now. thanks for going through the trouble Link to comment https://forums.phpfreaks.com/topic/77399-solved-problem-with-options-on-form/#findComment-391817 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.