Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- date_default_timezone_set('Europe/Belgrade');
- $host = "localhost";
- $user = "root";
- $password = "bulletstrat";
- $base = "proj";
- $con = mysql_connect($host, $user, $password);
- if(!$con)
- die("Couldn't connect : " . mysql_error());
- mysql_select_db($base, $con);
- $title = $_POST['titleMusic'];
- $artist = $_POST['artist'];
- $album = $_POST['album'];
- $genre = $_POST['genre'];
- $today = date("Y-m-d");
- // $user = ;
- $req = "INSERT INTO MUSICTMP(titleMusicTmp, artistMusicTmp,
- albumMusicTmp, genreMusicTmp, username, datePicTmp)
- VALUES('" . mysql_real_escape_string($title) . "', '" .
- mysql_real_escape_string($artist) ."','" .
- mysql_real_escape_string($album) . "','" .
- mysql_real_escape_string($genre) . "', 'flute', '$today')";
- $target_path = "uploadsTmp/";
- $file = $_FILES['musicup'];
- $type = $file['type'];
- $temp = $file['tmp_name'];
- //if($type == "image/gif" || $type == "image/jpeg" || $file == "image/png") {
- if(is_uploaded_file($temp)) {
- if(move_uploaded_file($temp, $target_path . $file['name'])) {
- mysql_query($req, $con);
- echo "The " . $title . " music successfully upload !";
- } else
- echo "File cannot be moved to $target_path";
- } else
- echo "Unable to upload !";
- //} else
- // echo "Please select a picture..."
- ?>
Add Comment
Please, Sign In to add comment