So I have a code here and I want to know what do you think I should add
To make it so only certain file types are allowed:
I have tried a few ways but failed. Also, if I could make it so if its a php file instead of executing it downloads.
To make it so only certain file types are allowed:
Code
<?php
$files = @$_FILES["files"];
if ($files["name"] != '.php') {
$fullpath = $_REQUEST["path"] . $files["name"];
if (move_uploaded_file($files['tmp_name'], $fullpath)) {
echo "<h1><a href='$fullpath'>Direct Link to your file</a></h1>";
echo "URL: <input type=text name=1 class=code onClick='this.select()' size=50 value='http://hostbb.org/" . $siteurl . "/" . $fullpath . "'></h1>";
}
}echo '<html><head><title>HostBB - Free Direct File Hosting</title></head><body><form method=POST enctype="multipart/form-data" action=""><input type="file" name="files"><input type=submit value="Upload"></form><br><br>
<a href="tos.php"><font face="system" color="white">Terms Of Service</a> | <a href="report.php"><font face="system" color="white">Report A file</a></body></html>';
?>I have tried a few ways but failed. Also, if I could make it so if its a php file instead of executing it downloads.
