-
Notifications
You must be signed in to change notification settings - Fork 0
/
staffappsent.php
60 lines (52 loc) · 2.15 KB
/
staffappsent.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
<?php
// Connect to database
include_once 'php/config.php';
// Procedure
if(isset($_POST['sendapp'])) {
// Variables - DONT TOUCH
$name = $_POST['fname'];
$age = $_POST['age'];
$country = $_POST['country'];
$timezone = $_POST['timezone'];
$steamid = $_POST['steamid'];
$howlong = $_POST['howlong'];
$why = $_POST['why'];
$what = $_POST['what'];
$microphone = $_POST['microphone'];
$references = $_POST['references'];
// Insert query
$sql = "INSERT INTO staffapps (fname, country, timezone, reference, steamid, howlong, why, what, microphone) VALUES ('$name', '$country', '$timezone', '$references', '$steamid', '$howlong', '$why', '$what', '$microphone')";
if (mysqli_query($link, $sql)) {
echo "<script type='text/javascript'>alert('Your application has been sent!');</script>";
} else {
echo "ERROR: " . $sql . "" . mysqli_error($conn);
}
}
// Discord webhook
$webhook = "https://discordapp.com/api/webhooks/664186711428825120/Qy7dnyt3d5JlNWyNghpD7bhubqo-PNTJNKomgMrp39blqvm32XKZv_0Adwz8IH1kBCbA";
$msg = "**Ny staff ansøgning!**\n**Navn:** $name\n**";
$json_data = array('content'=>"$msg");
$make_json = json_encode($json_data);
$ch = curl_init( $webhook );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $make_json);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec( $ch );
// Close connection
mysqli_close($link);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta http-equiv="refresh" content="3; url = http://anarchyroleplay.com">
<title>Anarchy Roleplay | Staff Application Sent!</title>
</head>
<body>
</body>
</html>