Created
September 14, 2015 12:34
-
-
Save ozcan/cd3901531e4c45e2680e to your computer and use it in GitHub Desktop.
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
| <?php | |
| $base = '/var/www/upload'; | |
| $name = $_POST['name']; | |
| $surname = $_POST['surname']; | |
| $path = $base . '/' . $name; | |
| if (!file_exists($path)) | |
| mkdir($path); | |
| $path = $path . '/' . $surname; | |
| if (!file_exists($path)) | |
| mkdir($path); | |
| $path = $path . '/' . basename($_FILES['kulldosyasi']['name']); | |
| if (move_uploaded_file($_FILES['kulldosyasi']['tmp_name'], $path)) | |
| { | |
| echo "Dosya geçerli ve başarıyla yüklendi.\n"; | |
| } else { | |
| echo "Olası dosya yükleme saldırısı!\n"; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment