forked from OpenKJ/StandaloneRequestServer
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreq-send.php
More file actions
36 lines (30 loc) · 807 Bytes
/
req-send.php
File metadata and controls
36 lines (30 loc) · 807 Bytes
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
<?php
include('global.inc');
$songid = $_POST['songid'];
$singer = $_POST['singer'];
if ($singer == '') {
reqFormContent($songid);
die();
}
$entries = null;
$wherestring = null;
$artist = '';
$title = '';
$sql = "SELECT artist,title FROM songdb WHERE song_id = $songid";
foreach ($db->query($sql) as $row) {
$artist = $row['artist'];
$title = $row['title'];
}
$stmt = $db->prepare("INSERT INTO requests (singer,artist,title) VALUES(:singer, :artist, :title)");
$stmt->execute(array(":singer" => $singer, ":artist" => $artist, ":title" => $title));
newSerial();
echo "<p>Request sent for $singer</p>
<div class=\"req-modal-buttons\">
<button
type=\"button\"
class=\"close\"
hx-on:click=\"htmx.trigger('#req-modal', 'remove-req-modal');\"
>Close</button>
</div>";
die();
?>