this is the code i have so far, but even when i select a file when it gets to the move file part it shows that no file was uploaded:
echo "Welcome to the upload facility so you can update the current league standings...<br><br>\n";
if (isset($_POST['file'])) {
if (!strpos($_POST['file'],"yac_league") && !strpos($_POST['file'],"ybc_league")) {//display error if filename is wrong
echo "The filename for the standings is incorrect! Please rename then re-upload.\n";
} else {
echo $_FILES['file']['tmp_name'].' - '.$path.$_FILES['file']['name'];
//outputs: - ./league/
if (move_uploaded_file($_FILES['file']['tmp_name'],$path.$_FILES['file']['name'])) {
echo "League standings uploaded successfully!\n";
} else {
echo "Failed to upload!\n";
}
}
} else {//display upload form
echo "Here is the form to upload the file:\n
<form method='post' action='".$_SERVER['REQUEST_URI']."'>\n
<input type='file' name='file' class='field2'><br>\n
<input type='submit' value='Upload!' class='submit'><br>\n
</form>\n";
}
==EDiT==
does the name of the file type field matter?