BroChris
01-21-2006, 11:18 PM
I've got two questions, both relating to an upload form. I've done this many times on many sites, but I can't seem to get it to work on the site I'm currently working on. The folder is set to be writable. I can't think of anything else that's wrong. Is anything wrong with this code, and if not, is there anything else I can check?
Relevant code:
<?php
if($action=="send"){
$picture=$_FILES['picture']['name'];
$path = "images/" . $picture;
move_uploaded_file($_FILES['picture']['tmp_name'], $path);
}
?>
<form action="uploadpicture.php?action=send" method="post">
<input type="file" id="picture" name="picture" maxlength="500">
<input type="submit" value="send">
</form>
My second question has to do with repopulating the file field if another required field was left blank. My typical method (filling the value field with the variable) doesn't seem to work.
Thanks in advance!
Relevant code:
<?php
if($action=="send"){
$picture=$_FILES['picture']['name'];
$path = "images/" . $picture;
move_uploaded_file($_FILES['picture']['tmp_name'], $path);
}
?>
<form action="uploadpicture.php?action=send" method="post">
<input type="file" id="picture" name="picture" maxlength="500">
<input type="submit" value="send">
</form>
My second question has to do with repopulating the file field if another required field was left blank. My typical method (filling the value field with the variable) doesn't seem to work.
Thanks in advance!