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 } ?> Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.