Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. session_start();
  3. ?>
  4. <?php
  5. include __DIR__ . '/function.php';
  6. $currentUser = getCurrentUser();
  7. if (null !== $currentUser && isset($_FILES['img']) && 0 == $_FILES['img']['error'] && is_uploaded_file($_FILES['img']['tmp_name'])) {
  8. copy($_FILES['img']['tmp_name'],
  9. __DIR__ . '/images/' . $_FILES['img']['name'] . ''
  10. );
  11. echo 'Your photo was successfully downloaded, Thank you !';
  12. $path = __DIR__ . '/log/log.txt';
  13. $log = $currentUser . '=>' . $_FILES['img']['name'] . ' ' . 'at' . ' ' . date(DATE_RFC822) . PHP_EOL;
  14. $record = file_put_contents($path, $log, FILE_APPEND);
  15. } else {
  16. header('Location: /Autentificationform.php');
  17. }
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement