This script has worked for me for years. Suddenly I'm getting the error message when clicking the upload button.
Can anyone help?
The upload page:
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p><b>Click "Choose File" button to upload a file:</b></p>
<div class="spacer"></div>
<input type="file" name="uploaded_file"></input><br />
<div class="spacer"></div>
<input type="submit" value="Upload" class="button"></input>
</form>
<FORM Method = "POST" action ="admin_main.php">
<input type="submit" name="Submit" value="Finished" class="button">
</FORM>
The upload file (upload.php):
<?PHP
if(!empty($_FILES['uploaded_file']))
{
$path = "A-Images/";
$path = $path . basename( $_FILES['uploaded_file']['name']);
if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path))
{header("Location: admin_main.php");}
else
{echo "There was an error uploading the file, please try again!";}
}
echo "The file ". basename( $_FILES['uploaded_file']['name']). " has been uploaded";
?>
I'm thinking it has to do with using a new version of PHP, but can't say for sure. I changed the version back to 7, but it still isn't working.
Any help appreciated!
Can anyone help?
The upload page:
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p><b>Click "Choose File" button to upload a file:</b></p>
<div class="spacer"></div>
<input type="file" name="uploaded_file"></input><br />
<div class="spacer"></div>
<input type="submit" value="Upload" class="button"></input>
</form>
<FORM Method = "POST" action ="admin_main.php">
<input type="submit" name="Submit" value="Finished" class="button">
</FORM>
The upload file (upload.php):
<?PHP
if(!empty($_FILES['uploaded_file']))
{
$path = "A-Images/";
$path = $path . basename( $_FILES['uploaded_file']['name']);
if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path))
{header("Location: admin_main.php");}
else
{echo "There was an error uploading the file, please try again!";}
}
echo "The file ". basename( $_FILES['uploaded_file']['name']). " has been uploaded";
?>
I'm thinking it has to do with using a new version of PHP, but can't say for sure. I changed the version back to 7, but it still isn't working.
Any help appreciated!