Add contact form spambot honeytrap

master
Skylar Ittner 5 years ago
parent 3a08a2e50c
commit f93a528822

@ -28,7 +28,7 @@ function output_card($content) {
<?php
}
if (empty($_POST['name']) || empty($_POST['message']) || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
if (empty($_POST['name']) || empty($_POST['message']) || !filter_var($_POST['real_email'], FILTER_VALIDATE_EMAIL) || !empty($_POST['email'])) {
$content = <<<END
<p>Whoops! You didn't fill out the contact form properly.</p>
<p><a href="javascript:history.back()" class="btn btn-primary btn-sm">Go back</a> and try again.</p>
@ -42,7 +42,7 @@ $siteid = getsiteid();
$database->insert("messages", [
"siteid" => $siteid,
"name" => htmlspecialchars($_POST['name']),
"email" => htmlspecialchars($_POST['email']),
"email" => htmlspecialchars($_POST['real_email']),
"message" => htmlspecialchars($_POST['message']),
"date" => date("Y-m-d H:i:s")
]);

@ -17,6 +17,10 @@ include __DIR__ . "/inc/header.inc.php";
</div>
<div class="container">
<form action="<?php get_site_url(); ?>contact.php" method="POST">
<span style="display: none;">
Leave this box empty
<input name="email" id="email" placeholder="Email" type="email" style="display: none;" autocomplete="off" />
</span>
<div class="row">
<div class="col-12 col-md-6 mb-3">
<label for="name">Name</label>
@ -24,7 +28,7 @@ include __DIR__ . "/inc/header.inc.php";
</div>
<div class="col-12 col-md-6 mb-3">
<label for="email">Email</label>
<input type="email" class="form-control" name="email" id="email" placeholder="you@example.com" required />
<input type="email" class="form-control" name="real_email" id="email" placeholder="you@example.com" required />
</div>
<div class="col-12">
<label for="message">Message</label>

@ -10,13 +10,17 @@
<h2 class="major"><?php get_page_clean_title(); ?></h2>
<p class="sw-text" data-component="lead"><?php get_component("lead"); ?></p>
<form method="post" action="contact.php">
<span style="display: none;">
Leave this box empty
<input name="email" id="email" placeholder="Email" type="email" style="display: none;" autocomplete="off" />
</span>
<div class="field half first">
<label for="name">Name</label>
<input type="text" name="name" id="name" required />
</div>
<div class="field half">
<label for="email">Email</label>
<input type="text" name="email" id="email" required />
<input type="text" name="real_email" id="email" required />
</div>
<div class="field">
<label for="message">Message</label>
@ -46,7 +50,7 @@
</div>
<?php include __DIR__ . "/inc/bg-edit.inc.php"; ?>
</div>
<?php include __DIR__ . "/inc/footer.inc.php"; ?>

@ -163,13 +163,17 @@ include __DIR__ . "/inc/head.inc.php";
<div class="split style1">
<section>
<form method="post" action="contact.php">
<span style="display: none;">
Leave this box empty
<input name="email" id="email" placeholder="Email" type="email" style="display: none;" autocomplete="off" />
</span>
<div class="field half first">
<label for="name">Name</label>
<input type="text" name="name" id="name" required />
</div>
<div class="field half">
<label for="email">Email</label>
<input type="email" name="email" id="email" required />
<input type="email" name="real_email" id="email" required />
</div>
<div class="field">
<label for="message">Message</label>

@ -6,11 +6,15 @@ include __DIR__ . "/inc/header.inc.php";
<?php get_component("contact-header"); ?>
</div></h2>
<form method="post" action="contact.php">
<span style="display: none;">
Leave this box empty
<input name="email" id="email" placeholder="Email" type="email" style="display: none;" autocomplete="off" />
</span>
<div class="field">
<input type="text" name="name" id="name" placeholder="Name" />
</div>
<div class="field">
<input type="email" name="email" id="email" placeholder="Email" />
<input type="email" name="real_email" id="email" placeholder="Email" />
</div>
<div class="field">
<textarea name="message" id="message" placeholder="Message" rows="4"></textarea>

@ -2,13 +2,17 @@
<footer id="footer">
<section>
<form method="post" action="contact.php">
<span style="display: none;">
Leave this box empty
<input name="email" id="email" placeholder="Email" type="email" style="display: none;" autocomplete="off" />
</span>
<div class="field">
<label for="name">Name</label>
<input type="text" name="name" id="name" required />
</div>
<div class="field">
<label for="email">Email</label>
<input type="text" name="email" id="email" required />
<input type="text" name="real_email" id="email" required />
</div>
<div class="field">
<label for="message">Message</label>

@ -4,11 +4,15 @@
<section>
<h2>Get in touch</h2>
<form method="post" action="contact.php">
<span style="display: none;">
Leave this box empty
<input name="email" id="email" placeholder="Email" type="email" style="display: none;" autocomplete="off" />
</span>
<div class="field half first">
<input type="text" name="name" id="name" placeholder="Name" required />
</div>
<div class="field half">
<input type="email" name="email" id="email" placeholder="Email" required />
<input type="email" name="real_email" id="email" placeholder="Email" required />
</div>
<div class="field">
<textarea name="message" id="message" placeholder="Message" required ></textarea>

@ -19,6 +19,10 @@
</h3>
<form action="<?php get_site_url(); ?>contact.php" method="POST">
<span style="display: none;">
Leave this box empty
<input name="email" id="email" placeholder="Email" type="email" style="display: none;" autocomplete="off" />
</span>
<div class="row">
<div class="6u 12u(medium)">
<label for="name">Name</label>
@ -26,7 +30,7 @@
</div>
<div class="6u 12u(medium)">
<label for="email">Email</label>
<input type="email" name="email" id="email" placeholder="you@example.com" required />
<input type="email" name="real_email" id="email" placeholder="you@example.com" required />
</div>
<div class="12u">
<label for="message">Message</label>

Loading…
Cancel
Save