feedback.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Feedback | PHP Form</title>
<meta name="description" content="Stylish PHP feedback form with email sending.">
<meta name="keywords" content="PHP, feedback form, contact form, send email php, modern css design">
<style>
body {
background: #e3f2fd;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.feedback-form {
background: white;
padding: 25px;
border-radius: 12px;
box-shadow: 0 10px 25px rgba(0,0,0,0.1);
max-width: 400px;
width: 100%;
}
.feedback-form h3 {
text-align: center;
margin-bottom: 20px;
}
input, textarea {
width: 100%;
margin-bottom: 15px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 8px;
}
button {
width: 100%;
background: #2196f3;
color: white;
border: none;
padding: 10px;
font-size: 16px;
border-radius: 8px;
}
button:hover {
background: #1976d2;
}
</style>
</head>
<body>
<form class="feedback-form" action="feedback.php" method="post">
<h3>Send Feedback</h3>
<input type="text" name="name" placeholder="Your Name" required>
<input type="email" name="email" placeholder="Your Email" required>
<textarea name="message" placeholder="Your Message" rows="5"></textarea>
<button type="submit">Submit</button>
</form>
</body>
</html>
feedback.php
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$to = "your@email.com";
$subject = "New Feedback from " . $_POST['name'];
$message = "From: " . $_POST['name'] . "\nEmail: " . $_POST['email'] . "\nMessage:\n" . $_POST['message'];
$headers = "From: feedback@yourdomain.com";
if (mail($to, $subject, $message, $headers)) {
echo "Thanks for your feedback!";
} else {
echo "Something went wrong, please try again.";
}
}
?>