Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2. if (file_exists($_FILES['image']['tmp_name']) || is_uploaded_file($_FILES['image']['tmp_name'])) {
  3. $f = '/imgs789';
  4. $host = '127.0.0.1';
  5. $dbname = 'f36545_db';
  6. $dbuser = 'f36545_dbuser';
  7. $dbpass = 'k9TlP>uBiEDsIHie';
  8. $link = mysqli_connect($host, $dbuser, $dbpass, $dbname) or die(mysqli_error($link));
  9. $link -> set_charset("utf8");
  10. $link -> query("INSERT INTO `photo_hotel` (`_id`) VALUES (NULL)") or die(mysqli_error($link));
  11. $pid = $link -> insert_id;
  12. $url = $imgf.$pid.".img";
  13. $to = $f."/".$pid.".png";
  14. move_uploaded_file($_FILES['image']['tmp_name'], $to);
  15. }
  16. else{
  17. echo 'file not uploaded';
  18. }
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement