Implementing contact form on JQM site...

Implementing contact form on JQM site...

Hi, as per my previous posts I'm new to JQM so appreciate any help you can give me.

The final piece in the jigsaw of finishing my first JQM site is adding the contact form. I already have a contact form up and running on my desktop version of the site so hopefully I'm halfway there!

Presumably the form code and functionality will work as normal but can anyone guide me on where to start? Using the same code as my full site doesn't work and i just get 'error loading page'

Here is the form html:
  1. <form action="form_contact2.php" method="post">
  2.   <table>
  3.     <tr class="top">
  4.       <td><div align="left">Name*</div></td>
  5.       <td><input name="Name" type="text" size="25" /></td>
  6.       </tr>
  7.     <tr class="top">
  8.       <td><div align="left">Email*</div></td>
  9.       <td><input name="Email" type="text" size="25" /></td>
  10.       </tr>
  11.           <tr class="top">
  12.             <td><div align="left">How Can We Help?</div></td>
  13.             <td><textarea name="Comments" cols="18" rows="9" ></textarea></td>
  14.           </tr>
  15.         <tr class="top">
  16.           <td>&nbsp;</td>
  17.           <td><input name="submit" type="image" src="images/submit.png" /></td>
  18.         </tr>
  19.   </table>
  20. </form>
  21.  
and here is the code for the processing file ' form_contact2.php'

  1. <?php
  2. session_start();
  3. header("Cache-control: private");

  4. $Name = $_POST['Name'];
  5. $Email = $_POST['Email'];
  6. $Company = $_POST['Company'];
  7. $Address = $_POST['Address'];
  8. $Telephone = $_POST['Telephone'];
  9. $Comments = $_POST['Comments'];

  10. $strMailTo = 'info@magnetikmedia.co.uk';
  11. $strSubject = 'Enquiry from Website';
  12. $strBody = "Dear Magnetik Media \n
  13. Enquiry $Comments \n
  14. Received from \n
  15. $Name \n
  16. Company $Company \n
  17. Address $Address \n
  18. Email $Email \n
  19. Phone $Telephone";

  20. if (empty($Name) || empty($Telephone) || empty($Email)) {
  21.     header( "Location: form_error.php" );
  22.   }
  23. else {

  24. $From = "From: \"$Name\" <$Email>\nX-Mailer: PHP/" . phpversion();

  25. mail ($strMailTo, $strSubject, $strBody, $From);

  26. header( "Location: thanks.htm");
  27. }
  28. ?>
Is it just a case of getting the URL's right as I tried making 'thanks.htm' and 'error.php' full URL's but no luck.
    • Topic Participants

    • info