okay workin on an upload script - its one ive had for awhile, and its worked before - well I'm bringing it back for a board I visit but I'm having a problem.
I have this section of code:
$dbh=mysql_connect ('localhost', 'e_novative', 'e_novative') or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ('uploads');
$dir = "dir";
if ($file != "") {
if (file_exists("$absolute_path/$file_name")) {
die("File already exists");
}
The line that says if ($file != "") { throws me an error. This is in the section of code for it to upload the file then post the path and the filename along with an ID number to a mysql database. After I try to upload the file, it gives me this error:
Notice: Undefined variable: file in \files\upload.php on line 256
Line 256 is the one where it checks to see if variable $file is not empty. I dont know how to fix this. 🙁