contactphpantibot/form_struct.php

64 lines
2.3 KiB
PHP
Raw Permalink Normal View History

<h2>Contact</h2>
<p>Vous voulez me spammer ? Heu, me contacter ? Laissez-moi un gentil mot :)</p>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="POST">
<div>
<!-- Token CSRF -->
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($_SESSION['csrf_token']); ?>">
<!-- pour les bots -->
<input type="hidden" name="try" value="send">
<input type="hidden" name="nobotv" value="<?php echo $nobot; ?>">
<!-- Si j'ajoute "required", ça foire pour demander à changer de question... donc on va faire sans, de toute façon c'est ensuite testé par php. -->
<div>
<label for="name"><?php echo $txt['name']; ?></label>
<input type="text" id="name" name="name" placeholder="Nom">
</div>
<div>
<label for="email"><?php echo $txt['mail']; ?></label>
<input type="email" id="email" name="email" placeholder="Courriel">
</div>
<div>
<label for="subject"><?php echo $txt['subject']; ?></label>
<input type="text" id="subject" name="subject" placeholder="Titre du message">
</div>
<div>
<label for="message"><?php echo $txt['message']; ?></label>
<textarea id="message" name="message" rows="6" cols="50" placeholder="Entrer votre message"></textarea>
</div>
<!-- Antibot -->
<div class="areyoubot">
<div>
<input id="nobotc" type="checkbox" name="nobotc" value="<?php echo md5($nobot); ?>" />
<label for="nobotc"><?php echo $txt['human']; ?></label>
<p style="position: absolute; visibility: hidden; left: -5000; top: -5000">
<input id="nobots" type="checkbox" name="nobots" value="<?php echo time(); ?>" />
<label for="nobots"><?php echo $txt['bot']; ?></label>
</p>
</div>
<!-- Questions -->
<div>
<div>
<label for="answer"><?php echo htmlspecialchars($current_question); ?></label>
</div>
<div>
<input type="text" id="answer" name="answer">
</div>
</div>
<!-- Envoyer -->
<div>
<input type="hidden" name="action" value="submit_form">
<ul class="actions">
<li><button type="submit" name="action" value="new_question" >Demander une autre question</button></li>
<li><button type="submit" name="action" value="submit_form" class="primary"><?php echo $txt['submit_button']; ?></button></li>
</ul>
</div>
</div>
</div>
</form>