Okay
  Public Ticket #1975063
Contact form not working
Closed

Comments

  • Dr_Nikhil started the conversation

    Hi,

    The contact form is not working. When the"submit" button is pressed, the form opens mail.php instead of executing properly. 

    Here is the code from mail.php

    <?php
    if(isset($_POST['email'])){
            $mailTo = "[email protected]";
            $subject = "mail from web";
            $body = "New message from web
    <br><br>
    FROM: ".$_POST['email']."<br>
    NAME: ".$_POST['name']."<br>
    COMMENTS: ".$_POST['message']."<br>";   
            $headers = "To: Solido <".$mailTo.">\r\n";
            $headers .= "From: ".$_POST['author']." <".$_POST['email'].">\r\n";
            $headers .= "Content-Type: text/html";
            //envio destinatario
            $mail_success =  mail($mailTo, utf8_decode($subject), utf8_decode($body), $headers);        
    }
    ?>  


    and here is the code for the form


    <!-- Contact Section Start -->
        <section id="section-contact" class="contact-us">
            <div class="container">
                <div class="row justify-content-center js-inview">
                    <div class="col-12">
                        <div class="voffset-120"></div>
                        <div class="section__header">
                            <h2 class="section__title js-inview_h tra20 delay01">Get in touch </h2>
                             <span><br/></span>
                          
                        </div>
                        <div class="voffset-80"></div>
                    </div>
                </div>
            </div>
            <div class="container contact-info">
                <div class="row js-inview">
                     <div class="col-4">
                     <div class="contact-address">
                            <div class="voffset-50"></div>
                            <h3 class="js-inview_h tra20 delay06">Advert Eyez LTD</h3>
                            <h4 class="js-inview_h tra20 delay06">Contact us:</h4>
                            <p class="js-inview_h tra20 delay07">D3, Mayfair Maisonettes, Mpaka rd, Westlands - Nairobi
                                <br>Email: <a href="#">[email protected]</a>
                                <br>Phone: +254 722 343279
                                <br>Or :   +254 734 855593</p>
                                 <div class="voffset-30"></div>
                                <h4 class="js-inview_h tra20 delay06">Follow us:</h4>
                                 <ul>
                                 <li class="nav-social">
                                    <ul>
                                       

                                                                        
                                    
                                    </ul>
                                </li>
                                 </ul>
                        </div>
                    </div>
                    <div class="col-8">
                        <div class="voffset-60"></div>
                        <form action="mail.php" method="post" id="contactform" class="contact-form">
                            <div class="form-group">
                                <input name="firstname" type="text" class="form-control  js-inview_h tra20 delay01" id="input-name" placeholder="First name">
                            </div>
                            <div class="form-group">
                                <input name="lastname" type="text" class="form-control  js-inview_h tra20 delay02" id="input-lastname" placeholder="Last name">
                            </div>
                            <div class="form-group">
                                <input name="email" type="text" class="form-control  js-inview_h tra20 delay03" id="input-email" placeholder="Your email address">
                            </div>
                             <div class="form-group">
                                <input name="phone" type="text" class="form-control  js-inview_h tra20 delay03" id="input-phone" placeholder="Where are you from?">
                            </div>
                            <div class="form-group js-inview_h tra20 delay04">
                                <textarea name="message" class="form-control" id="input-message" rows="1" placeholder="Enter your message"></textarea>
                            </div>
                            <p>We know how important your information is.
    It is always safe with us.</p>
                            
                            <input type="submit" value="SEND MESSAGE" class="btn btn-primary js-inview_h tra20 delay05">
                        </form>
                        <div class="voffset-180"></div>
                       
                    </div>
                </div>
            </div>
            
        </section>
    <!-- Contact Section End -->



  •  850
    Jelly replied

    Hello,

    Could you please follow this guide https://jellythemes.ticksy.com//article/8964/?

    Best Regards,
    Jelly Team

  • Dr_Nikhil replied

    When I add this script to main.js the page stops loading. 


    /*Validation*/  $("#contactform").validate({    submitHandler: function(form) {      $(form).ajaxSubmit();      $('.formSent').show();      $(form).find('input[type=text]').val('');      $(form).find('input[type=email]').val('');      $(form).find('textarea').val('');    }  });


  •  850
    Jelly replied

    Could you please send us ftp login/password/url to your website as a private message? I am going to apply this customization.

    Best Regards,
    Jelly Team

  •   Dr_Nikhil replied privately
  •  850
    Jelly replied

    I've added everything to html and js files but for some reason can't see any change in files. Do you have some kind of server cache software installed?

    Best Regards,
    Jelly Team

  •   Dr_Nikhil replied privately
  •  850
  •   Dr_Nikhil replied privately
  •  850
    Jelly replied

    Added the code. Please check and let me know.

    Best Regards,
    Jelly Team

  • Dr_Nikhil replied

    It works thank you!!

  •  850
    Jelly replied

    Perfect!

    I am currently closing the ticket. Please don’t hesitate to submit a ticket whenever you need help. I will be happy to assist you.

    P.S. I would appreciate if you could please rate the Theme and like the assistance under my support, means a lot to me. Thank you.

    You can rate it with your themeforest account at your downloads page, precisely at this link: http://themeforest.net/downloads and hover over the 5 stars for our theme.

    Thank you so much for all your help!!!

    Best Regards,
    Jelly Team