Can anyone take a look at this and tell me what is wrong?
When I echo the variables, I notice that nothing is showing up for $filename.
This is really bugging me because I'm almost delerious I've been up so long trying to figure this out.
Please help!..
-------------------------------Start Upload Form
<form name=\"contractform\" method=\"post\" action=\"writer.php?p=upload_contract&sl=links_auction\">
<input name=\"userfile\" type=\"file\">
<input type=\"hidden\" name=\"id\" value=\"" . $auction_entry . "\">
<input type=\"hidden\" name=\"bidder\" value=\"" . $bidder_name . "\">
<input class=\"button\" type=\"submit\" name=\"submit\" value=\"Upload!\">
</form>
-------------------------------Start Upload Script
$file_name = basename( $_FILES['userfile']['name']);
$up_accname = ucfirst($accname);
//Modify the following path to the required destination path.
$folder_path = "project_files/" . $up_accname . "projects/" .$up_accname . "legal/";
$file_loc = $folder_path . $filename;
$target_path = "../" . $folder_path . $file_name;
echo $target_path . "<br><br>" . $file_loc . "<br><br>" . $file_name;
if(move_uploaded_file($_FILES['userfile']['tmp_name'], $target_path))
{
$query="UPDATE $bid_table SET external_contract='$file_loc', mbd_contract='0' WHERE bid_from='$bidder_name'";
if($query)
{
echo "The file ". basename( $_FILES['userfile']['name']). " has been uploaded";
}
else
{
echo "Could not write to table" . mysql_error();
}
}
else
{
echo "There was an error uploading the file, please try again!";
}