D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
markniuj
/
bazmeasar.com
/
Filename :
subscribe.php
back
Copy
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>subscribe</title> <!-- responsive meta --> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- For IE --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Module css --> <link rel="stylesheet" href="css.css"> </head> <header> <div class="logo"><a href='index.php'><img src="admin/logo.png"></a></div> <!---menu start--> <div class="menu"> </div> <!---menu end--> </header> <?php // Handle the form submission if ($_SERVER["REQUEST_METHOD"] == "POST") { // Retrieve user input from the form $email = $_POST["email"]; $name = isset($_POST["name"]) ? $_POST["name"] : null; $phone = isset($_POST["phone"]) ? $_POST["phone"] : null; $subscription_date = date("Y-m-d"); // Get the current date // Insert data into the subscribers table $sql = "INSERT INTO subscribers (email, name, phone, subscription_date) VALUES (?, ?, ?, ?)"; $stmt = $conn->prepare($sql); $stmt->bind_param("ssss", $email, $name, $phone, $subscription_date); if ($stmt->execute()) { echo "<h1>Thank you for subscribing</h1><br><a href='index.php'>Go back to home</a>"; } else { echo "Error: " . $stmt->error; } // Close the database connection $conn->close(); } ?>