-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_careerType_proc.php
55 lines (32 loc) · 1.16 KB
/
add_careerType_proc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
require('library/session.inc');
require('library/connect.inc');
//Test the array to see if it works.
// print_r($_POST);
$album_name = $_POST['album_name'];
$artist = $_POST['artist'];
$genre = $_POST['genre'];
$date = $_POST['date'];
$song_num = $_POST['song_num'];
$total_time = $_POST['total_time'];
//going to store images in a folder in order to move a file it is another global. $_FILES, filename, filetype, filesize.
//explode the file name to include. jpg, gif,png,
$image_path = 'album_art/'.$_FILES['image']['name'];
$image_size = $_FILES['image']['size'];
//$image_type = $_FILES['image']['type'];
//echo $album_name, $artist, $genre, $date;
if($image_size = 0) {
echo 'Thats not an image';
}else {
move_uploaded_file($_FILES['image']['tmp_name'], $image_path);
}
$query = "INSERT INTO albums(album_name, date, artist, song_num, total_time, genre, image)
VALUES ('$album_name', '$date', '$artist', '$song_num', '$total_time', '$genre', '$image_path')";
$result = mysqli_query($connect, $query);
if(!$result) {
echo 'na begin agin.';
}else{
//echo 'All you bass belongs to us. ';
header('location:admin_home.php');
}
?>