javascript - Contact form using php inside phonegap gives success alert but cant find mail -


basically question mirror of previous 1 in stack overflow. form works after success alert, don't find mail sent designated email id.

after click send button if success alert means mail has been sent successfully, when check name@example.com (dummy) should see mail in inbox cant find one. may problem. doing wrong?

contact.html

 <html>     <head>     <link rel = "stylesheet" href="css/theme.min.css"/>     <link rel="stylesheet" href="css/jquery.mobile-1.2.1.css"/>     <script type="text/javascript" charset="utf-8" src="js/jquery-1.6.1.min.js"></script>     <script type="text/javascript" charset="utf-8" src="cordova.js"></script>     <script type="text/javascript" charset="utf-8" src="js/jquery.mobile-1.2.1.min.js"></script>     <script type="text/javascript">     // when document has loaded...     $(document).ready(function() {       // bind action function executed when button clicked...       $('input[type="button"][value="send"]').click(function() {         $.post('http://www.techmagzine.com/contact_us.php', {            // these names of form values           // edit: have wrong ids on these...            firstname: $('#txtfullname').val(),           lastname: $('#txtemail').val(),           email: $('#txtcontact').val(),           messagetext: $('#txtmessage').val()            // html function            }, function (html) {               // place html in astring               var response=html;                // php done , email sent               if (response=="success") {                 alert("message sent!");                  clear();               } else {                  // error postback                 alert("please fill fields!");                  return false;               }         });       });     });     </script>     </head>     <body>     <div data-role="page" id="front" data-theme="b">       <div class="header" id="header" data-role="header">        <h3>contact-us</h3>       </div>        <div data-role="content">              <label for="txtfullname">firstname</label>             <input id="txtfullname" name="firstname" type="text" placeholder="required" required />              <label for="txtemail">lastname</label>             <input id="txtemail" name="lastname" type="text" placeholder="required" required  />              <label for="txtcontact">email</label>             <input id="txtcontact" name="email" type="email" placeholder="required" required />              <label for="txtmessage">message</label>             <textarea id="txtmessage" name="messagetext" placeholder="required" rows="10" required ></textarea>            <input type="button" value="send"/>          </div>       </div>      </body>     </html> 

contact_us.php

<?php      // vars     $firstname=$_post["firstname"];     $lastname=$_post["lastname"];     $email=$_post["email"];     $messagetext=$_post["messagetext"];     $headers = "from:" . $email;      //validation     if(     $firstname=="" ||     $lastname=="" ||     $email=="" ||     $messagetext==""     ) {         echo "error";     } else {         mail("name@example.com","mobile app message",$messagetext, $headers);         echo "success";     } ?> 


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -