Is there a way to store the filename in a variable for later use?
$filename = mysql_real_escape_string($_POST['userfile']);
And that is empty.
I am a noob at PHP so please forgive me if this is a dumb question but I just can't work it out.
TIA




3 Votes
Posted 04 March 2009 - 04:03 AM
$filename = mysql_real_escape_string($_POST['userfile']);
Posted 29 July 2009 - 02:23 PM
<input type="hidden" name="MAX_FILE_SIZE" value="2048000">
<input type="hidden" name="MAX_FILE_SIZE" value="2048000" />
Posted 31 August 2009 - 05:50 AM
skyhawk133, on 9 Dec, 2004 - 11:42 AM, said:
<form enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="2048000">
File: <input name="userfile" type="file" /><br />
<input type="submit" value="Upload" />
</form>
<?php
if (@is_uploaded_file($_FILES["userfile"]["tmp_name"])) {
copy($_FILES["userfile"]["tmp_name"], "/images/" . $_FILES["userfile"]["name"]);
echo "<p>File uploaded successfully.</p>";
}
?>
