having trouble inserting a variable into the database..it keeps inserting "type1" instead of the would be value. Im sure its simple problem.
please advise
here is my code:
if(move_uploaded_file($_FILES['the_file']['tmp_name'], './img/' . $_FILES['the_file']['name']))
{
$location = "./img/" . $_FILES['the_file']['name'];
$type = 'type1';
print "OK ".$location;
mysql_query("INSERT INTO blueprints2 (blueprint_id, name, location, type, storys, bedrooms, bathrooms) VALUES(NULL,'".$_FILES[the_file][name]."','$location','$type','two',1,2)") or die("Insert Error".mysql_error());
}
else print "Nope".$_FILES['the_file']['tmp_name'];
mysql_close();
} else{
?>
<form action="store_binary2.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value ="100000" />
select a file to upload:<input type="file" name ="the_file" />
<br/>
<select name="type1">
<option value="detached"> detached </option>
<option value="split"> split</option>
<option value="semi"> semi</option>
</select>
<input type="submit" name="submit" value="submit!" />
</form>