Jump to content

Lanxalot

New Members
  • Posts

    8
  • Joined

  • Last visited

Lanxalot's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks Gizmola, I changed the mail() function to wp_mail() and everything is working again. The form is good enough for now until the site is rebuilt. Thanks everyone for your help! It's really appreciated. Best wishes, Lanx
  2. Above is the complete template / form. Many thanks! 😊
  3. <?php /** * Template Name: Package * * @package WordPress * @subpackage Twenty_Seventeen * @since 1.0 * @version 1.0 */ get_header(); ?> <div class="wrap"> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <article id="package" class="page"> <div class="entry-content"> <div class="home-wrap side-padding max-width-1000"> <h1 class="page-title-handwriting padding-top-0pt4em"><?php the_title(); ?></h1> </div> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') : ?> <?php // Grab submitted fields $flagStyle = $_POST['flag-style']; $palette = $_POST['palette']; $noOfFlags = $_POST['no-of-flags']; $addBunting = $_POST['add-bunting']; $buntingLocation = $_POST['bunting-location']; $buntingLength = $_POST['length']; $deliveryOption = $_POST['delivery-option']; $buntingRefolding = $_POST['bunting-refolding']; $firstName = $_POST['your-first-name']; $surname = $_POST['your-surname']; $emailAddress = $_POST['your-email']; $phoneNumber = $_POST['your-phone']; $eventDate = $_POST['event-date']; $eventEndDate = $_POST['event-end-date']; $eventPostcode = $_POST['event-postcode']; $deliveryAddress = $_POST['delivery-address']; $deliveryAddressType = $_POST['delivery-address-type']; $deliveryContact = $_POST['event-contact']; $additionalComments = $_POST['additional-comments']; // Send the details by email $headers = "From: Event Flag Hire<hello@eventflaghire.co.uk>\r\n" . 'Reply-To: ' . $emailAddress; $to = "lanx@lanxworld.com"; $to = "studio@eventflaghire.co.uk"; $subject = "PACKAGE QUOTE ENQUIRY FORM"; $message = " CUSTOMER DETAILS\r\n Name: {$firstName} {$surname}\r\nEmail: {$emailAddress}\r\nTelephone: {$phoneNumber}\r\n"; $message .= " FLAG SPECIFICATION\r\n Flag Style: {$flagStyle}\r\nPalette: {$palette}\r\nNumber of flags: {$noOfFlags}\r\n"; $message .= " ADD ADDITIONAL BUNTING?\r\n Would you like to add additional bunting?: {$addBunting}\r\n"; $message .= "Bunting location: {$buntingLocation}\r\n"; if($addBunting == 'Yes'){ $message .= "Bunting length: {$buntingLength}m\r\n"; } $message .= " Bunting refolding required?: {$buntingRefolding}\r\n"; $message .= " DELIVERY\r\n Delivery option: {$deliveryOption}\r"; if($deliveryOption == 'Deliver'){ $message .= " Address Type: {$deliveryAddressType}"; } $message .= " \r\nEVENT DETAILS\r\n Event date: {$eventDate}\r\nEnd date (if event is more than one day): {$eventEndDate}\r\n"; if($deliveryOption == 'Deliver'){ $message .= "\r\nDelivery address: {$deliveryAddress}\r\n{$eventPostcode}\r\nDelivery contact: {$deliveryContact}\r\n"; } $message .= " ADDITIONAL COMMENTS\r\n {$additionalComments}\r\n"; mail($to, $subject, $message, $headers); ?> <div class="home-wrap side-padding max-width-1000" style="text-align:center;"> <h3 class="center padding-top-1em padding-bottom-1em no-text-transform mobile-side-padding text-left"><strong>Thanks for sending your enquiry through for your flag package.</strong></h3> <p>We will send you an official quote within 1 working day (normally much quicker!).</p> <p>Our bespoke handmade bunting is all made to order so we will also provide you our current lead-time. If you have any questions give us a call on 01749 850 991.</p> <p>For more decor please <a href="https://shop.eventflaghire.co.uk">visit our webshop</a>.</p> </div> <?php else: ?> <form id="package-enquiry-form" method="post" action="<?php the_permalink(); ?>"> <div id="package-loader" class="clearboth flag-strip"> <div class="loader">Loading, please wait&helip;</div> </div> <div id="package-step01" class="clearBoth flag-strip"> <fieldset class="package-section-title side-padding max-width-1000"> <legend><strong>Step 1:</strong> Choose your flag style</legend> <div class="home-wrap flag-styles"> <div class="center-big-flags center-big-flags-7"> <div class="flag-blueprint teal-hover"> <div> <input type="radio" class="flag-style" value="New Leaf" name="flag-style" id="flag-style-new-leaf"> <label for="flag-style-new-leaf" title="New Leaf"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-timeout=2000> <img src="https://www.eventflaghire.co.uk/wp-content/uploads/2020/05/Festival-Flags-New-Leaf.png" alt="Festival Flags New Leaf" /> </div> </label> </div> </div> <div class="flag-blueprint turquoise-hover"> <div> <input type="radio" class="flag-style" value="Silk & Ribbon" name="flag-style" id="flag-style-silk-and-ribbon"> <label for="flag-style-silk-and-ribbon" title="Silk & Ribbon"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-timeout=2000> <img src="https://www.eventflaghire.co.uk/wp-content/uploads/2020/05/Festival-Flags-Silk-Ribbon.png" alt="Festival Flags Silk & Ribbon" /> </div> </label> </div> </div> <div class="flag-blueprint teal-hover"> <div> <input type="radio" class="flag-style" value="Half Moon Petal" name="flag-style" id="flag-style-half-moon-petal"> <label for="flag-style-half-moon-petal" title="Half Moon Petal"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-timeout=2000> <img src="https://www.eventflaghire.co.uk/wp-content/uploads/2020/05/Festival-Flags-Half-Moon-Petal.png" alt="Festival Flags Half Moon Petal" /> </div> </label> </div> </div> <div class="flag-blueprint turquoise-hover"> <div> <input type="radio" class="flag-style" value="Indian Summer" name="flag-style" id="flag-style-indian-summer"> <label for="flag-style-indian-summer" title="Indian Summer"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-timeout=2000> <img src="https://www.eventflaghire.co.uk/wp-content/uploads/2020/05/Festival-Flags-Indian-Summer.png" alt="Festival Flags Indian Summer" /> </div> </label> </div> </div> <div class="flag-blueprint teal-hover"> <div> <input type="radio" class="flag-style" value="Phoenix" name="flag-style" id="flag-style-phoenix"> <label for="flag-style-phoenix" title="Phoenix"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-timeout=2000> <img src="https://www.eventflaghire.co.uk/wp-content/uploads/2023/03/Phoenix-Festival-Flag-Blueprint.png" alt="Phoenix Festival Flag Blueprint" /> </div> </label> </div> </div> <div class="flag-blueprint turquoise-hover"> <div> <input type="radio" class="flag-style" value="Bright Stripes" name="flag-style" id="flag-style-bright-stripes"> <label for="flag-style-bright-stripes" title="Bright Stripes"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-timeout=2000> <img src="https://www.eventflaghire.co.uk/wp-content/uploads/2020/05/Festival-Flags-Bright-Stripes.png" alt="Festival Flags Bright Stripes" /> </div> </label> </div> </div> <div class="flag-blueprint teal-hover"> <div> <input type="radio" class="flag-style" value="Calypso" name="flag-style" id="flag-style-calypso"> <label for="flag-style-calypso" title="Calypso"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-timeout=2000> <img src="https://www.eventflaghire.co.uk/wp-content/uploads/2023/03/Calypso-Flag-Blueprint-.png" alt="Calypso Flag Blueprint" /> </div> </label> </div> </div> </div> <div class="home-wrap topTwoButtons clearBoth" style="overflow:hidden; margin-top:32px;"> <div class="inline-button"> <input type="radio" class="flag-style" value="Choose for me" name="flag-style" id="flag-style-choose-for-me"> <label for="flag-style-choose-for-me">I love them all, choose for me</label> </div> </div> </div> </fieldset> </div> <div id="package-step02" class="clearBoth teal-background flag-strip"> <fieldset class="package-section-title side-padding max-width-1000"> <legend><strong>Step 2:</strong> Choose your colour palette</legend> <p>Get inspired by selecting one of our beautiful pre-set palettes below.</p> <ul class="palettes"> <li class="swatch-festival-mix"> <input type="radio" class="palette" value="Festival Mix" name="palette" id="palette-festival-mix"> <label for="palette-festival-mix" title="Festival Mix"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-speed="500" data-cycle-timeout=1000> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/festival-mix.svg" alt="Festival Mix"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Festival-Mix-Rollover.jpg" alt="Festival Mix"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Festival-Mix-Rollover-02.jpg" alt="Festival Mix"> </div> </label> </li> <li class="swatch-warm-hues"> <input type="radio" class="palette" value="Warm Hues" name="palette" id="palette-warm-hues"> <label for="palette-warm-hues" title="Warm Hues"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-speed="500" data-cycle-timeout=1000> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/warm-hues.svg" alt="Warm Hues"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Warm-Hues-Rollover.jpg" alt="Warm Hues"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Warm-Hues-Rollover-02.jpg" alt="Warm Hues"> </div> </label> </li> <li class="swatch-under-the-sea"> <input type="radio" class="palette" value="Under the Sea" name="palette" id="palette-under-the-sea"> <label for="palette-pastels" title="Under the Sea"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-speed="500" data-cycle-timeout=1000> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/under-the-sea.svg" alt="Under the Sea"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Under-the-Sea-Rollover.jpg" alt="Under the Sea"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Under-the-Sea-Rollover-02.jpg" alt="Under the Sea"> </div> </label> </li> <li class="swatch-pastels"> <input type="radio" class="palette" value="Pastels" name="palette" id="palette-pastels"> <label for="palette-pastels" title="Pastels"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-speed="500" data-cycle-timeout=1000> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/pastels.svg" alt="Pastels"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Pastels-Rollover.jpg" alt="Pastels"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Pastels-Rollover-02.jpg" alt="Pastels"> </div> </label> </li> <li class="swatch-white-ivory"> <input type="radio" class="palette" value="White &amp; Ivory" name="palette" id="palette-white-ivory"> <label for="palette-white-ivory" title="White &amp; Ivory"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-speed="500" data-cycle-timeout=1000> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/white-ivory.svg" alt="White &amp; Ivory"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/White-Ivory-Rollover.jpg" alt="White &amp; Ivory"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/White-Ivory-Rollover-02.jpg" alt="White &amp; Ivory"> </div> </label> </li> <li class="swatch-multicolour-rainbow"> <input type="radio" class="palette" value="Multicolour Rainbow" name="palette" id="palette-multicolour-rainbow"> <label for="palette-multicolour-rainbow" title="Multicolour Rainbow"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-speed="500" data-cycle-timeout=1000> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/multicolour-rainbow.svg" alt="Multicolour Rainbow"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Multicolour-Rainbow-Rollover.jpg" alt="Multicolour Rainbow"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Multicolour-Rainbow-Rollover-02.jpg" alt="Multicolour Rainbow"> </div> </label> </li> <li class="swatch-multicolour-warm-hues"> <input type="radio" class="palette" value="Multicolour Warm Hues" name="palette" id="palette-multicolour-warm-hues"> <label for="palette-multicolour-warm-hues" title="Multicolour Warm Hues"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-speed="500" data-cycle-timeout=1000> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/multicolour-warm-hues.svg" alt="Multicolour Warm Hues"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Multicolour-Warm-Hues-Rollover.jpg" alt="Multicolour Warm Hues"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Multicolour-Warm-Hues-Rollover-02.jpg" alt="Multicolour Warm Hues"> </div> </label> </li> <li class="swatch-multicolour-cool-hues"> <input type="radio" class="palette" value="Multicolour Cool Hues" name="palette" id="palette-multicolour-cool-hues"> <label for="palette-multicolour-cool-hues" title="Multicolour Cool Hues"> <div class="cycle-slideshow" data-cycle-fx=fadeout data-cycle-speed="500" data-cycle-timeout=1000> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/multicolour-cool-hues.svg" alt="Multicolour Cool Hues"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Multicolour-Cool-Hues-Rollover.jpg" alt="Multicolour Cool Hues"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/img/swatches/rollovers/Multicolour-Cool-Hues-Rollover-02.jpg" alt="Multicolour Cool Hues"> </div> </label> </li> </ul> </fieldset> </div> <div id="package-step03" class="clearBoth flag-strip"> <fieldset class="package-section-title side-padding max-width-1000"> <legend><strong>Step 3:</strong> How many flags do you need?</legend> <div class="inline-buttons"> <div class="inline-button"> <input type="radio" class="number-of-flags" value="6 flags + 25m bunting" name="no-of-flags" id="flags-6"> <label for="flags-6">6 FLAGS <span>+ 25m bunting</span></label> <span><strong>&pound;235 (ex VAT)</strong><br>&pound;282 (inc VAT)</span> </div> <div class="inline-button"> <input type="radio" class="number-of-flags" value="10 flags + 40m bunting" name="no-of-flags" id="flags-10"> <label for="flags-10">10 FLAGS <span>+ 40m bunting</span></label> <span><strong>&pound;340 (ex VAT)</strong><br>&pound;408 (inc VAT)</span> </div> <div class="inline-button"> <input type="radio" class="number-of-flags" value="20 flags + 50m bunting" name="no-of-flags" id="flags-20"> <label for="flags-20">20 FLAGS <span>+ 50m bunting</span></label> <span><strong>&pound;565 (ex VAT)</strong><br>&pound;678 (inc VAT)</span> </div> <div class="inline-button"> <input type="radio" class="number-of-flags" value="25 flags + 100m bunting" name="no-of-flags" id="flags-25"> <label for="flags-25">25 FLAGS <span>+ 100m bunting</span></label> <span><strong>&pound;750 (ex VAT)</strong><br>&pound;900 (inc VAT)</span> </div> </div> </fieldset> </div> <div id="package-step04" class="clearBoth teal-background flag-strip"> <fieldset class="teal-background package-section-title side-padding max-width-1000"> <legend><strong>Step 4:</strong> Would you like to add additional bunting?</legend> <div class="home-wrap topTwoButtons" style="overflow:hidden;"> <div class="col-half"> <div class="inline-button"> <input type="radio" class="add-bunting" value="Yes" name="add-bunting" id="add-bunting-yes"> <label for="add-bunting-yes">YES</label> </div> </div> <div class="col-half"> <div class="inline-button"> <input type="radio" class="add-bunting" value="No" name="add-bunting" id="add-bunting-no"> <label for="add-bunting-no">NO</label> </div> </div> </div> <fieldset class="package-section-title side-padding max-width-1000"> <legend>Is your bunting for inside or outside use?</legend> <div class="home-wrap topTwoButtons"> <div class="col-half"> <div class="inline-button"> <input type="radio" value="Inside" name="bunting-location" id="bunting-location-inside"> <label for="bunting-location-inside">INSIDE</label> </div> </div> <div class="col-half"> <div class="inline-button"> <input type="radio" value="Outside" name="bunting-location" id="bunting-location-outside"> <label for="bunting-location-outside">OUTSIDE</label> </div> </div> </div> </fieldset> <div id="extra-bunting-options"> <fieldset class="package-section-title side-padding max-width-1000"> <legend>Choose your length in metres</legend> <div class="bunting-length"> <label for="length">Length</label> <input class="text" type="number" name="length" id="length" min="10" step="10" value="20" onKeyDown="return false"> </div> <div class="bunting-price"> <p>&pound;<span class="price">1.50</span> + VAT <small>per metre</small></p> </div> </fieldset> </div> <fieldset class="teal-background package-section-title side-padding max-width-1000"> <legend>Would you like a refolding service?</legend> <div class="home-wrap topTwoButtons"> <div class="col-half"> <div class="inline-button"> <input type="radio" class="bunting-refolding" value="Yes" name="bunting-refolding" id="bunting-refolding-yes"> <label for="bunting-refolding-yes">YES</label> <span>We offer a refolding service for 40p (+ VAT) per metre if required.</span> </div> </div> <div class="col-half"> <div class="inline-button"> <input type="radio" class="bunting-refolding" value="No" name="bunting-refolding" id="bunting-refolding-no"> <label for="bunting-refolding-no">NO</label> <span>Return the bunting unfolded, we will provide instructions.</span> </div> </div> </div> </fieldset> </fieldset> </div> <div id="package-step05" class="clearBoth flag-strip"> <fieldset class="package-section-title side-padding max-width-1000"> <legend><strong>Step 5:</strong> Choose your delivery option</legend> <div class="home-wrap topTwoButtons"> <div class="col-half"> <div class="inline-button"> <input type="radio" class="delivery-option" value="Deliver" name="delivery-option" id="delivery-option-deliver"> <label for="delivery-option-deliver">DELIVER</label> <span>Delivery and return is via next day courier.</span> </div> </div> <div class="col-half"> <div class="inline-button"> <input type="radio" class="delivery-option" value="Collection" name="delivery-option" id="delivery-option-collection"> <label for="delivery-option-collection">COLLECT</label> <span>Collection is from our office in Bruton, Somerset. Return next day courier.</span> </div> </div> </div> <div id="deliveryAddressType" class="home-wrap topTwoButtons" style="margin-top: 20px;"> <div class="col-half"> <div class="inline-button"> <input type="radio" class="delivery-address-type" value="Residential" name="delivery-address-type" id="delivery-address-type-residential"> <label for="delivery-address-type-residential">RESIDENTIAL</label> <span>Residential addresses will incur a &pound;10 surcharge each way for orders with flag poles.</span> </div> </div> <div class="col-half"> <div class="inline-button"> <input type="radio" class="delivery-address-type" value="Business" name="delivery-address-type" id="delivery-address-type-business"> <label for="delivery-address-type-business">BUSINESS</label> </div> </div> </div> </fieldset> </div> <div id="package-step06" class="clearBoth teal-background flag-strip"> <fieldset class="package-section-title side-padding max-width-1000"> <legend><strong>Step 6:</strong> Enter your contact details</legend> <div class="your-details"> <label for="your-first-name">Your first name*</label> <input type="text" name="your-first-name" id="your-first-name" required> <label for="your-surname">Your surname*</label> <input type="text" name="your-surname" id="your-surname" required> <label for="your-email">Your email address*</label> <input type="email" name="your-email" id="your-email" required> <label for="your-phone">Your phone number*</label> <input type="tel" name="your-phone" id="your-phone" required> </div> </fieldset> </div> <div id="package-step07" class="clearBoth flag-strip"> <fieldset class="package-section-title side-padding max-width-1000"> <legend><strong>Step 7:</strong> Enter your event details</legend> <div class="your-details"> <div class="question-with-note"> <label for="event-date">Date of event*</label> <input type="text" class="datepicker" name="event-date" id="event-date" required> <a class="info-link" href="#">Information</a> <div class="question-note"> <p>Weekly rental period commences on a Wednesday and finishes on a Tuesday. If the rental period incorporates 2 weekends this a 2 week rental but charge a 1.5 times rental fee.</p> <p>Most events take place on a weekend. We aim to despatch on a Wednesday for arrival on a Thursday to be erect on a Friday for an event on either Friday, Saturday or Sunday. We then collect on a Monday and the items are returned to us on a Tuesday. They are then unpacked, checked and repacked to be despatched again on a Wednesday to a different destination.</p> <p>Any collections on a Friday are delivered on a Monday and therefore deemed as a lost weekend rental. Couriers do not work on Sundays but can deliver on a Saturday for an additional fee.</p> <p>We can be flexible with a Tuesday either sending out a day early or collecting a day later but at the height of season we are dependent on all our stock being returned when agreed and without damage, or wet or dirty which leaves us little time to rectify these problems between orders.</p> </div> </div> <label for="event-end-date">End date (if event is more than one day)</label> <input type="text" class="datepicker" name="event-end-date" id="event-end-date"> <label for="event-postcode">Delivery postcode*</label> <input type="text" name="event-postcode" id="event-postcode" required> <div class="delivery-specific-field"> <div class="question-with-note"> <label for="delivery-address">Delivery address*</label> <textarea name="delivery-address" id="delivery-address"></textarea> <a class="info-link" href="#">Information</a> <div class="question-note"> <p>This should be an address that someone will be available to sign for the delivery a couple of days before your event date and the next working day after. This should not be a venue/field that a courier would not be able to deliver to. Delivery and collection addresses can be different.</p> </div> </div> <label for="event-contact">Contact name &amp; number for delivery (if different)</label> <input type="text" name="event-contact" id="event-contact"> </div> <label for="additional-comments">Any additional comments/requirements?</label> <p><small>For example, let us know if you require a base for your flags.</small></p> <textarea name="additional-comments" id="additional-comments"></textarea> <p>By sending your enquiry you agree to our <a href="/terms-conditions/" target="_blank" rel="noopener">terms and conditions</a>.</p> <input type="submit" value="Send enquiry"> </div> </fieldset> </div> </form> <?php endif; ?> </div> </div><!-- .entry-content --> </article><!-- #post-## --> </main><!-- #main --> </div><!-- #primary --> </div><!-- .wrap --> <?php get_footer();
  4. The form was working fine, I believe a small amount of code may have been removed before i inherited the site. I understand you would build this in a superior way. For now, I just want to make the form that is there work. On the front end, the form works well. The SMTP on the site works well, and other forms send fine. This form worked well before (I think some code was removed). The form hasn't stopped working because of spam. The server and domain reputation are good, as are all other emails being sent from the same site. Hopefully somebody can see something that is missing. Many thanks!
  5. Thanks for the answers. I see no errors. The template completely overrides the content of a WordPress page. Before this override, the WordPress page had a shortcode for a Contact Form 7 form. The form looked messy. A previous developer made this template, which should within itself, collect data from the defined fields (this part I believe works), and then submit this data to to an email address. I can't see any code which would complete the latter. When the submit button is pressed, a success message shows, but nothing is sent. What I'm wondering, is how can I make the content gathered by the rest of the code (some of which is missing but I believe it works) send an email? Is there anything obvious that is missing?
  6. Hi @Barand, many thanks, do I need to repost the code?
  7. I have inherited a site with a PHP form that has stopped working. The level of coding is beyond my skills, however I think there may be a simple solution, as the form previously worked fine. Is there a piece of PHP that needs adding to make the submit button at the bottom post the gathered information? Here is the top and bottom of the form with the PHP code. I removed a large part of the form body (it is too big to paste it all) and some HTML text (replaced with 'text removed'). I believe the important code is still present. Any help or advice will be so much appreciated: <?php /** * Template Name: Package * * @package WordPress * @subpackage Twenty_Seventeen * @since 1.0 * @version 1.0 */ get_header(); ?> <div class="wrap"> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <article id="package" class="page"> <div class="entry-content"> <div class="home-wrap side-padding max-width-1000"> <h1 class="page-title-handwriting padding-top-0pt4em"><?php the_title(); ?></h1> </div> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') : ?> <?php // Grab submitted fields $flagStyle = $_POST['flag-style']; $palette = $_POST['palette']; $noOfFlags = $_POST['no-of-flags']; $addBunting = $_POST['add-bunting']; $buntingLocation = $_POST['bunting-location']; $buntingLength = $_POST['length']; $deliveryOption = $_POST['delivery-option']; $buntingRefolding = $_POST['bunting-refolding']; $firstName = $_POST['your-first-name']; $surname = $_POST['your-surname']; $emailAddress = $_POST['your-email']; $phoneNumber = $_POST['your-phone']; $eventDate = $_POST['event-date']; $eventEndDate = $_POST['event-end-date']; $eventPostcode = $_POST['event-postcode']; $deliveryAddress = $_POST['delivery-address']; $deliveryAddressType = $_POST['delivery-address-type']; $deliveryContact = $_POST['event-contact']; $additionalComments = $_POST['additional-comments']; // Send the details by email $headers = "From: Event Flag Hire<hello@eventflaghire.co.uk>\r\n" . 'Reply-To: ' . $emailAddress; $to = "lanx@lanxworld.com"; $to = "studio@eventflaghire.co.uk"; $subject = "PACKAGE QUOTE ENQUIRY FORM"; $message = " CUSTOMER DETAILS\r\n Name: {$firstName} {$surname}\r\nEmail: {$emailAddress}\r\nTelephone: {$phoneNumber}\r\n"; $message .= " FLAG SPECIFICATION\r\n Flag Style: {$flagStyle}\r\nPalette: {$palette}\r\nNumber of flags: {$noOfFlags}\r\n"; $message .= " ADD ADDITIONAL BUNTING?\r\n Would you like to add additional bunting?: {$addBunting}\r\n"; $message .= "Bunting location: {$buntingLocation}\r\n"; if($addBunting == 'Yes'){ $message .= "Bunting length: {$buntingLength}m\r\n"; } $message .= " Bunting refolding required?: {$buntingRefolding}\r\n"; $message .= " DELIVERY\r\n Delivery option: {$deliveryOption}\r"; if($deliveryOption == 'Deliver'){ $message .= " Address Type: {$deliveryAddressType}"; } $message .= " \r\nEVENT DETAILS\r\n Event date: {$eventDate}\r\nEnd date (if event is more than one day): {$eventEndDate}\r\n"; if($deliveryOption == 'Deliver'){ $message .= "\r\nDelivery address: {$deliveryAddress}\r\n{$eventPostcode}\r\nDelivery contact: {$deliveryContact}\r\n"; } $message .= " ADDITIONAL COMMENTS\r\n {$additionalComments}\r\n"; mail($to, $subject, $message, $headers); ?> <div class="home-wrap side-padding max-width-1000" style="text-align:center;"> <h3 class="center padding-top-1em padding-bottom-1em no-text-transform mobile-side-padding text-left"><strong>Thanks for sending your enquiry through for your flag package.</strong></h3> <p>We will send text removed</p> <p>For more decor please <a href="text removed">text removed</a>.</p> </div> <?php else: ?> <form id="package-enquiry-form" method="post" action="<?php the_permalink(); ?>"> <div id="package-loader" class="clearboth flag-strip"> <div class="loader">Loading, please wait&helip;</div> </div> <div id="package-step01" class="clearBoth flag-strip"> <fieldset class="package-section-title side-padding max-width-1000"> <legend><strong>Step 1:</strong> Choose your flag style</legend> <div id="package-step07" class="clearBoth flag-strip"> <fieldset class="package-section-title side-padding max-width-1000"> <legend><strong>Step 7:</strong> Enter your event details</legend> <div class="your-details"> <div class="question-with-note"> <label for="event-date">Date of event*</label> <input type="text" class="datepicker" name="event-date" id="event-date" required> <a class="info-link" href="#">Information</a> <div class="question-note"> <p>Weekly rental period . . .</p> </div> </div> <label for="event-end-date">End date (if event is more than one day)</label> <input type="text" class="datepicker" name="event-end-date" id="event-end-date"> <label for="event-postcode">Delivery postcode*</label> <input type="text" name="event-postcode" id="event-postcode" required> <div class="delivery-specific-field"> <div class="question-with-note"> <label for="delivery-address">Delivery address*</label> <textarea name="delivery-address" id="delivery-address"></textarea> <a class="info-link" href="#">Information</a> <div class="question-note"> <p>This should be an address . . .</p> </div> </div> <label for="event-contact">Contact name text removed</label> <input type="text" name="event-contact" id="event-contact"> </div> <label for="additional-comments">Any additional comments/requirements?</label> <p><small>For example text removed</small></p> <textarea name="additional-comments" id="additional-comments"></textarea> <p>By sending your enquiry you agree to our <a href="/terms-conditions/" target="_blank" rel="noopener">terms and conditions</a>.</p> <input type="submit" value="Send enquiry"> </div> </fieldset> </div> </form> <?php endif; ?> </div> </div><!-- .entry-content --> </article><!-- #post-## --> </main><!-- #main --> </div><!-- #primary --> </div><!-- .wrap --> <?php get_footer(); ``<?php /** * Template Name: Package * * @package WordPress * @subpackage Twenty_Seventeen * @since 1.0 * @version 1.0 */ get_header(); ?> <div class="wrap"> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <article id="package" class="page"> <div class="entry-content"> <div class="home-wrap side-padding max-width-1000"> <h1 class="page-title-handwriting padding-top-0pt4em"><?php the_title(); ?></h1> </div> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') : ?> <?php // Grab submitted fields $flagStyle = $_POST['flag-style']; $palette = $_POST['palette']; $noOfFlags = $_POST['no-of-flags']; $addBunting = $_POST['add-bunting']; $buntingLocation = $_POST['bunting-location']; $buntingLength = $_POST['length']; $deliveryOption = $_POST['delivery-option']; $buntingRefolding = $_POST['bunting-refolding']; $firstName = $_POST['your-first-name']; $surname = $_POST['your-surname']; $emailAddress = $_POST['your-email']; $phoneNumber = $_POST['your-phone']; $eventDate = $_POST['event-date']; $eventEndDate = $_POST['event-end-date']; $eventPostcode = $_POST['event-postcode']; $deliveryAddress = $_POST['delivery-address']; $deliveryAddressType = $_POST['delivery-address-type']; $deliveryContact = $_POST['event-contact']; $additionalComments = $_POST['additional-comments']; // Send the details by email $headers = "From: Event Flag Hire<hello@eventflaghire.co.uk>\r\n" . 'Reply-To: ' . $emailAddress; $to = "lanx@lanxworld.com"; $to = "studio@eventflaghire.co.uk"; $subject = "PACKAGE QUOTE ENQUIRY FORM"; $message = " CUSTOMER DETAILS\r\n Name: {$firstName} {$surname}\r\nEmail: {$emailAddress}\r\nTelephone: {$phoneNumber}\r\n"; $message .= " FLAG SPECIFICATION\r\n Flag Style: {$flagStyle}\r\nPalette: {$palette}\r\nNumber of flags: {$noOfFlags}\r\n"; $message .= " ADD ADDITIONAL BUNTING?\r\n Would you like to add additional bunting?: {$addBunting}\r\n"; $message .= "Bunting location: {$buntingLocation}\r\n"; if($addBunting == 'Yes'){ $message .= "Bunting length: {$buntingLength}m\r\n"; } $message .= " Bunting refolding required?: {$buntingRefolding}\r\n"; $message .= " DELIVERY\r\n Delivery option: {$deliveryOption}\r"; if($deliveryOption == 'Deliver'){ $message .= " Address Type: {$deliveryAddressType}"; } $message .= " \r\nEVENT DETAILS\r\n Event date: {$eventDate}\r\nEnd date (if event is more than one day): {$eventEndDate}\r\n"; if($deliveryOption == 'Deliver'){ $message .= "\r\nDelivery address: {$deliveryAddress}\r\n{$eventPostcode}\r\nDelivery contact: {$deliveryContact}\r\n"; } $message .= " ADDITIONAL COMMENTS\r\n {$additionalComments}\r\n"; mail($to, $subject, $message, $headers); ?> <div class="home-wrap side-padding max-width-1000" style="text-align:center;"> <h3 class="center padding-top-1em padding-bottom-1em no-text-transform mobile-side-padding text-left"><strong>Thanks for sending your enquiry through for your flag package.</strong></h3> <p>We will send text removed</p> <p>For more decor please <a href="text removed">text removed</a>.</p> </div> <?php else: ?> <form id="package-enquiry-form" method="post" action="<?php the_permalink(); ?>"> <div id="package-loader" class="clearboth flag-strip"> <div class="loader">Loading, please wait&helip;</div> </div> <div id="package-step01" class="clearBoth flag-strip"> <fieldset class="package-section-title side-padding max-width-1000"> <legend><strong>Step 1:</strong> Choose your flag style</legend> <label for="event-end-date">End date (if event is more than one day)</label> <input type="text" class="datepicker" name="event-end-date" id="event-end-date"> <label for="event-postcode">Delivery postcode*</label> <input type="text" name="event-postcode" id="event-postcode" required> <div class="delivery-specific-field"> <div class="question-with-note"> <label for="delivery-address">Delivery address*</label> <textarea name="delivery-address" id="delivery-address"></textarea> <a class="info-link" href="#">Information</a> <div class="question-note"> <p>This should be an address . . .</p> </div> </div> <label for="event-contact">Contact name text removed</label> <input type="text" name="event-contact" id="event-contact"> </div> <label for="additional-comments">Any additional comments/requirements?</label> <p><small>For example text removed</small></p> <textarea name="additional-comments" id="additional-comments"></textarea> <p>By sending your enquiry you agree to our <a href="/terms-conditions/" target="_blank" rel="noopener">terms and conditions</a>.</p> <input type="submit" value="Send enquiry"> </div> </fieldset> </div> </form> <?php endif; ?> </div> </div><!-- .entry-content --> </article><!-- #post-## --> </main><!-- #main --> </div><!-- #primary --> </div><!-- .wrap --> <?php get_footer();
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.