-
Notifications
You must be signed in to change notification settings - Fork 0
/
submit_form.php
52 lines (44 loc) · 1.65 KB
/
submit_form.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
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = $_POST['name'];
$email = $_POST['email'];
$wallet_address = $_POST['wallet_address'];
$nft_task = $_POST['nft_task'];
// Process the data (e.g., save to a database or send an email notification)
// Example: Save to a database
// $servername = "localhost";
// $username = "username";
// $password = "password";
// $dbname = "your_database";
// Create connection
// $conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
// if ($conn->connect_error) {
// die("Connection failed: " . $conn->connect_error);
// }
// // Insert data into database
// $sql = "INSERT INTO nft_claim_requests (name, email, wallet_address, nft_task)
// VALUES ('$name', '$email', '$wallet_address', '$nft_task')";
// if ($conn->query($sql) === TRUE) {
// echo "NFT claim request submitted successfully.";
// } else {
// echo "Error: " . $sql . "<br>" . $conn->error;
// }
// $conn->close();
// Example: Send an email notification
$to = "admin@example.com"; // Replace with your email address
$subject = "NFT Claim Request";
$message = "Name: $name\n";
$message .= "Email: $email\n";
$message .= "Wallet Address: $wallet_address\n";
$message .= "NFT Task: $nft_task\n";
$headers = "From: $email";
if (mail($to, $subject, $message, $headers)) {
echo "Thank you, $name! Your NFT claim request has been submitted.";
} else {
echo "Oops! Something went wrong and we couldn't process your request.";
}
} else {
echo "Access denied.";
}
?>