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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.