Jump to content

[SOLVED] Problem with options on form


atticus

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.