Created
April 1, 2025 10:15
-
-
Save thevillagehacker/63f438698527e21bf6d72ff339016968 to your computer and use it in GitHub Desktop.
Code 03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function addfile($user) { | |
$file = "files/".basename($user)."/".basename($_FILES["file"]["name"]); | |
if (!preg_match("/\.pdf/", $file)) { | |
return "Only PDF are allowed"; | |
} elseif (!move_uploaded_file($_FILES["file"]["tmp_name"], $file)) { | |
return "Sorry, there was an error uploading your file."; | |
} | |
return NULL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment