How to build a simple feedback form for blog readers
A simple feedback form gives blog readers a direct way to report broken links, suggest topics, request clarification, or ask business-related questions. It turns scattered comments into structured information you can use while helping visitors feel heard without creating an account or completing a complicated survey.
This guide covers an accessible, mobile-friendly contact form built with HTML, CSS, and a small PHP handler. It also explains validation, spam protection, privacy notices, and testing, whether your blog runs on traditional hosting or a managed WordPress platform.
Start with the job the form should do
Decide what you want to achieve before selecting fields. If the main goal is to improve articles, ask for the page URL, feedback type, and message. If you want to generate qualified business enquiries, collect the visitor’s name, email address, service of interest, and a short description of the requirement.
Keep the form short. Name, email, feedback category, optional location, message, and consent are usually enough. Ask for a phone number, company size, budget, or detailed project information only when it directly determines whether you can help.
Avoid making every field compulsory. An optional name makes it easier for someone to report a typo, while requiring an email address is reasonable only if you intend to respond. Use plain labels such as “Your feedback” and “Send feedback” rather than technical language that could confuse visitors.
Create the form with semantic HTML
Place the form near the end of an article, where readers have already formed an opinion. Use explicit label elements, native input types, clear required indicators, and a single descriptive button. The following example also includes Australian states and territories, a privacy-oriented consent box, and a hidden honeypot field for basic spam filtering.
<?php
session_start();
if (empty($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
}
?>
<form action="/feedback-submit.php" method="post" class="feedback-form">
<p id="feedback-intro">Tell us what would make this blog more useful.</p>
<div class="field">
<label for="feedback-name">Name</label>
<input id="feedback-name" name="name" type="text"
autocomplete="name" maxlength="80">
</div>
<div class="field">
<label for="feedback-email">Email</label>
<input id="feedback-email" name="email" type="email"
autocomplete="email" required>
</div>
<div class="field">
<label for="feedback-type">Feedback type</label>
<select id="feedback-type" name="feedback_type">
<option>Content</option>
<option>Technical issue</option>
<option>Business enquiry</option>
<option>Something else</option>
</select>
</div>
<div class="field">
<label for="feedback-state">State or territory</label>
<select id="feedback-state" name="state">
<option value="">Prefer not to say</option>
<option>New South Wales</option>
<option>Victoria</option>
<option>Queensland</option>
<option>South Australia</option>
<option>Western Australia</option>
<option>Tasmania</option>
<option>Australian Capital Territory</option>
<option>Northern Territory</option>
</select>
</div>
<div class="field">
<label for="feedback-message">Your feedback</label>
<textarea id="feedback-message" name="message" required
maxlength="3000"></textarea>
</div>
<label class="consent">
<input type="checkbox" name="consent" value="yes" required>
I agree to the blog contacting me about this feedback.
</label>
<input class="honeypot" type="text" name="website" tabindex="-1"
autocomplete="off" aria-hidden="true">
<input type="hidden" name="csrf_token"
value="<?= htmlspecialchars($_SESSION['csrf_token'], ENT_QUOTES, 'UTF-8') ?>">
<button type="submit">Send feedback</button>
</form>
The PHP before the form creates a session token, which prevents another site from submitting requests under your visitor’s session. Generate a fresh token after a successful submission and reject expired or mismatched values on the server.
Browser validation provides immediate guidance, but it is not security. Repeat every important check in the submission handler, including length limits, email format, consent, allowed feedback categories, and CSRF-token matching.
Style it for small screens and clear Australian tone
Many readers in Melbourne, Sydney, Brisbane, and Perth will encounter your form on a phone. Use a single-column layout, comfortable spacing, and inputs with at least 16-pixel text so iOS does not zoom when a field receives focus. Make the submit button large enough to tap easily.
.feedback-form {
max-width: 42rem;
margin: 2rem auto;
padding: 1.25rem;
font: 1rem/1.5 system-ui, sans-serif;
}
.feedback-form .field { margin-bottom: 1rem; }
.feedback-form label {
display: block;
margin-bottom: .35rem;
font-weight: 600;
}
.feedback-form input:not([type="checkbox"]),
.feedback-form select,
.feedback-form textarea {
box-sizing: border-box;
width: 100%;
min-height: 2.75rem;
padding: .7rem;
font-size: 1rem;
border: 1px solid #777;
border-radius: .35rem;
}
.feedback-form textarea { min-height: 10rem; resize: vertical; }
.feedback-form button {
min-height: 2.75rem;
padding: .7rem 1.2rem;
border: 0;
border-radius: .35rem;
background: #005a9c;
color: #fff;
font-weight: 700;
cursor: pointer;
}
.feedback-form :focus-visible {
outline: 3px solid #005fcc;
outline-offset: 2px;
}
.honeypot { position: absolute; left: -9999px; }
An informal Australian tone can make the form feel welcoming without sacrificing clarity. “Thanks for letting us know—no worries, we’ll take a look” is friendly, but validation messages should still identify the exact problem. Never display a generic error when the visitor has left a required message empty.
Time zones matter when you promise a response. Perth, Adelaide, Brisbane, and Sydney operate on different clocks, so say “within two working days” rather than suggesting an immediate reply. Show successful and error messages near the form, and preserve entered values when validation fails.
Protect privacy and stop abuse
Australia’s Privacy Act 1988 and the Australian Privacy Principles give personal information a clear framework. Explain who receives submissions, why you collect them, how long you keep them, and how a reader can request access or correction. Place this notice beside the form or link to a detailed privacy policy.
Consent should cover a genuine reply about the submitted message. If you later use the address for a marketing series, obtain separate permission and comply with the Spam Act 2003, including a clear unsubscribe mechanism. Never add newsletter subscribers automatically simply because they contacted you.
if (
empty($_SESSION['csrf_token']) ||
!hash_equals(
$_SESSION['csrf_token'],
$_POST['csrf_token'] ?? ''
)
) {
http_response_code(419);
exit('Your session expired. Please reload and try again.');
}
Use HTTPS, server-side validation, rate limiting, and a honeypot or challenge for suspicious traffic. Escape stored information whenever it is displayed. Do not request passwords, payment details, medical information, or other sensitive data through a general feedback form.
Connect submissions and test the full journey
Your form’s action value points to a server-side handler. This basic PHP example validates the submission and sends it to the blog owner. Replace the example sender and recipient with addresses configured for your domain, and use your host’s SMTP service if the built-in mail() function is unavailable.
<?php
session_start();
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405);
exit('Invalid request.');
}
if (!hash_equals(
$_SESSION['csrf_token'] ?? '',
$_POST['csrf_token'] ?? ''
)) {
http_response_code(419);
exit('Please reload the page and try again.');
}
if (!empty($_POST['website'])) {
exit('Thanks for your feedback.');
}
$name = trim($_POST['name'] ?? '');
$email = trim($_POST['email'] ?? '');
$message = trim($_POST['message'] ?? '');
$type = $_POST['feedback_type'] ?? 'Something else';
$state = $_POST['state'] ?? 'Not supplied';
if (
strlen($name) > 80 ||
!filter_var($email, FILTER_VALIDATE_EMAIL) ||
strlen($message) > 3000 ||
($_POST['consent'] ?? '') !== 'yes'
) {
http_response_code(422);
exit('Please check the form and try again.');
}
$body = "Type: $type\nState: $state\nName: $name\nEmail: $email\n\n$message";
$headers = "From: feedback@example.com.au\r\nReply-To: $email";
if (!mail(
'feedback@example.com.au',
'New blog feedback',
$body,
$headers
)) {
http_response_code(500);
exit('We could not send your feedback. Please try again.');
}
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
echo 'Thanks for your feedback.';
Test the complete process on a real phone and computer. Check keyboard navigation, visible focus, screen-reader labels, required fields, invalid email addresses, long messages, consent, spam submissions, and successful delivery. Confirm that the handler cannot be accessed directly to reveal source code.
Turn responses into useful improvements
Tag each response as content, technical, business, or general feedback. Record the related article and whether the issue was resolved. Measure completed submissions, response time, and the proportion of reports that lead to a correction, new tutorial, or useful resource.
If your audience includes hospitality owners running Melbourne laneway cafés or Sydney suburban bakeries, requests about online ordering can become a tailored guide. A relevant next step might be café digital activation, offered only to readers who request information and consent to follow-up.
If feedback leads to paid consulting or services, display prices in Australian dollars and state whether GST is included. Plain total pricing reduces confusion, especially when readers compare offers across Australia. Keep commercial messages relevant to the original enquiry rather than sending an unrelated sales sequence.
Close the loop publicly when possible. Publish a correction, update the article, or mention that a requested guide is now available. Readers are more likely to contribute again when they can see that their message produced a real change.
Your quickest launch uses six core fields, one clear button, a mobile layout, and a short privacy notice. Test the complete submission on a staging site before publishing it, then monitor early responses for missing fields or unexpected questions.
Add the form to your most popular article today, give it a recognizable destination such as /feedback, and schedule regular time to review the responses. A working feedback channel becomes an ongoing source of reader insight and business leads.