Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (file_exists($_FILES['image']['tmp_name']) || is_uploaded_file($_FILES['image']['tmp_name'])) {
- $f = '/imgs789';
- $host = '127.0.0.1';
- $dbname = 'f36545_db';
- $dbuser = 'f36545_dbuser';
- $dbpass = 'k9TlP>uBiEDsIHie';
- $link = mysqli_connect($host, $dbuser, $dbpass, $dbname) or die(mysqli_error($link));
- $link -> set_charset("utf8");
- $link -> query("INSERT INTO `photo_hotel` (`_id`) VALUES (NULL)") or die(mysqli_error($link));
- $pid = $link -> insert_id;
- $url = $imgf.$pid.".img";
- $to = $f."/".$pid.".png";
- move_uploaded_file($_FILES['image']['tmp_name'], $to);
- }
- else{
- echo 'file not uploaded';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement