芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/reginaeigbe.com/subscribe.php
connect_error) { die("Connection failed: " . $conn->connect_error); } if ($_SERVER["REQUEST_METHOD"] == "POST") { $email = $_POST['email']; // Check if email is already in the database $sql = "SELECT * FROM subscribers WHERE email='$email'"; $result = $conn->query($sql); if ($result->num_rows > 0) { echo "You are already subscribed!"; } else { // Insert new subscriber $stmt = $conn->prepare("INSERT INTO subscribers (email) VALUES (?)"); $stmt->bind_param("s", $email); if ($stmt->execute()) { echo "Subscription successful!"; } else { echo "Error: " . $stmt->error; } $stmt->close(); } } $conn->close(); ?>