Add Lead

Add Lead





connect_error) { die("Connection failed: " . $conn->connect_error); } // Sanitize the form input data $name = mysqli_real_escape_string($conn, $_POST['name']); $email = mysqli_real_escape_string($conn, $_POST['email']); $phone = mysqli_real_escape_string($conn, $_POST['phone']); $message = mysqli_real_escape_string($conn, $_POST['message']); // Insert the lead data into the database $sql = "INSERT INTO leads (name, email, phone, message) VALUES ('$name', '$email', '$phone', '$message')"; if ($conn->query($sql) === TRUE) { echo "Lead added successfully!"; } else { echo "Error: " . $sql . "
" . $conn->error; } // Close the database connection $conn->close(); } ?>