This is the form:
Expand|Select|Wrap|Line Numbers
- <form name="form1" id= "form1" method="post" action="formmail.php" onsubmit="return trappetyTrap();" enctype="multipart/form-data">
- <input type="hidden" name="recipients" value="me@email">
- <input type="hidden" name="good_url" value="http://whatever/good_page.php">
- <input type="hidden" name="bad_url" value="http://whatever/bad_page.php">
- <input type="hidden" name="subject" value="Sent from website">
- <label for="person">Your Name : </label>
- <input type="text" name="person" id="person" size="39">
- <label for="email">Email : </label>
- <input type="text" name="email" id="email" size="39">
- <label for="company">Company Name (if applicable):</label>
- <input type="text" name="company" id="company" size="39">
- <label for="phone">Contact Phone :</label>
- <input type="text" name="phone" id="phone" size="39">
- <!-- THIS IS TO KEEP THE B.O.T.S. AWAY-->
- <!-- IT USES THE JS AT THE BOTTOM OF THE DOCUMENT TO STOP SUBMISSIONS -->
- <!-- FROM ANYTHING WITH THIS FIELD FILLED IN -->
- <label for="ruse" id="ruse_label">Keep this field blank</label>
- <input type="text" name="ruse" id="ruse" class="ruse" />
- <!-- END B.O.T. TRAP -->
- <label for="message">Talk to us:</label>
- <textarea name="message" id="message" rows="10" cols="47"></textarea>
- <button type="submit" class="submit">Submit</button>
- </form>
Expand|Select|Wrap|Line Numbers
- function trappetyTrap() {
- // This is only here because jslint told me to put it here
- "use strict";
- // The field is empty, submit the form.
- if (!document.getElementById("ruse").value) {
- return true;
- // If an 'author' input exists - it's a spam bot
- } else if (document.getElementsByName("author")) {
- return false;
- } else {
- // the field has a value it's a spam bot
- return false;
- }
- }
Expand|Select|Wrap|Line Numbers
- From: <pberman@srafoods.com>
- Date: 7 Dec. 2017 3:50 am
- Subject: Imaginary Worlds Submission
- To: <me@email>
- Cc:
- email: pberman@srafoods.com
- realname:
- author:
- phone:
- storyTitle:
- storyFile:
Expand|Select|Wrap|Line Numbers
- // Get the value of the subject line of the email - add to variable
- var iws = document.getElementsByName("subject").value;
- // start function
- function trappetyTrap() {
- // This is only here because jslint told me to put it here
- "use strict";
- // The field is empty, submit the form.
- if (!document.getElementById("ruse").value) {
- return true;
- //} else if (iws === "Imaginary Worlds Submission") {
- return false;
- } else {
- // the field has a value it's a spam bot
- return false;
- }
- }