-
Notifications
You must be signed in to change notification settings - Fork 0
/
submit_music.php
102 lines (97 loc) · 3.86 KB
/
submit_music.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$artist_name = htmlspecialchars($_POST['artist_name']);
$song_title = htmlspecialchars($_POST['song_title']);
$email = htmlspecialchars($_POST['email']);
$message = htmlspecialchars($_POST['message']);
// Validate email
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo "<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>Submission Failed</title>
<style>
body { font-family: Arial, sans-serif; background-color: #f4f4f4; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; }
.container { background-color: #fff; padding: 20px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); border-radius: 8px; max-width: 500px; width: 100%; }
h1 { color: #dc3545; }
p { color: #333; }
</style>
</head>
<body>
<div class='container'>
<h1>Submission Failed</h1>
<p>Invalid email address. Please try again.</p>
</div>
</body>
</html>";
exit;
}
// Email details
$to = 'infinati@musikz.xyz';
$subject = 'New Music Submission';
$headers = "From: $email\r\n";
$headers .= "Reply-To: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$email_message = "<html>
<head>
<title>New Music Submission</title>
</head>
<body>
<h2>New Music Submission</h2>
<p><strong>Artist Name:</strong> $artist_name</p>
<p><strong>Song Title:</strong> $song_title</p>
<p><strong>Email:</strong> $email</p>
<p><strong>Message:</strong><br>$message</p>
</body>
</html>";
// Send email
if (mail($to, $subject, $email_message, $headers)) {
echo "<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>Submission Successful</title>
<style>
body { font-family: Arial, sans-serif; background-color: #f4f4f4; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; }
.container { background-color: #fff; padding: 20px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); border-radius: 8px; max-width: 500px; width: 100%; }
h1 { color: #28a745; }
p { color: #333; }
</style>
</head>
<body>
<div class='container'>
<h1>Submission Successful</h1>
<p>Thank you, $artist_name. Your song has been submitted successfully.</p>
</div>
</body>
</html>";
} else {
echo "<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>Submission Failed</title>
<style>
body { font-family: Arial, sans-serif; background-color: #f4f4f4; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; }
.container { background-color: #fff; padding: 20px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); border-radius: 8px; max-width: 500px; width: 100%; }
h1 { color: #dc3545; }
p { color: #333; }
</style>
</head>
<body>
<div class='container'>
<h1>Submission Failed</h1>
<p>Sorry, there was an error sending your submission. Please try again later.</p>
</div>
</body>
</html>";
}
}
?>