Forum Moderators: coopster
Here is the code when register globas was on
Upload Form:
<form method="post" action="iceschedupload.php" enctype="multipart/form-data">
<input type="hidden" name="action" value="upload">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><p class="headline"> File:</p> </td>
<td><input type="file" name="binFile"></td>
</tr>
<tr align="center">
<td COLSPAN="2"><br>
<input type="submit" value="Upload">
</td>
</tr>
</table>
</form>
upload script (iceschedupload.php):
if ($action == "upload") {
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
if (isset($binFile) && $binFile!= "none") {
$data = addslashes(fread(fopen($binFile, "r"), filesize($binFile)));
$strDescription = addslashes(nl2br($txtDescription));
$query = "INSERT INTO icesched VALUES (NULL,'$binFile_name','$binFile_size','$binFile_type','$data')";
mysql_query($query);
echo "<p class=normal>Thank you. The new file was successfully added to our database.</p><br><br>";
}
mysql_close();
} else {}
I have tried changing all of the values to be inserted to $_POST[variable here] but that didnt work. Can someone please help me!
Thank you
File upload information can be found within the $_FILES [php.net] superglobal. You are going to have to go through your code and replace your variables with the appropriate
$_FILES array elements. There is more information regarding file uploads at php.net: [php.net...] Good luck! :)