0 Replies Latest reply on Feb 2, 2011 9:40 AM by stmigs

    Contact Form No Message String

    stmigs

      Hello,

       

      I have been working with a flash template and have problem with my contact form. I am receiving the form but content does not appear to be posting correctly and I am not getting any information from my message field.

       

      Here is my formConfiguration.xml (my hosting site said I have to use webformmailer.php or gdform.php instead of contact.php)

       

      <?xml version="1.0" encoding="utf-8"?>

       

      <contactFormConfiguration>

        

      <emailTo>info@buddyfoto.com</emailTo>

       

       

      <serverProcessorType>php</serverProcessorType>

       

       

      <serverProcessorFileName>webformmailer</serverProcessorFileName>

       

       

      <messageSentText>THANK YOU FOR YOUR MESSAGE.</messageSentText>

       

       

      <validateRequiredOnly>true</validateRequiredOnly>

       

      <submitFormOnEnter>false</submitFormOnEnter>

       

      <!--

      <validationMessages>

      <email>This is not a valid e-mail address</email>

      <empty>All required fields must be filled</empty>

      <ntext>This is not a valid text. </ntext>

      <digits>Not valid characters. </digits>

      </validationMessages>

      -->

       

      <exitFullScreenMsg>You have to exit fullscreen mode to use contact form</exitFullScreenMsg>

       

       

       

      <messageSentFailedText>SORRY, YOUR MESSAGE COULDN'T BE SENT</messageSentFailedText>

       

       

      <formProcessingText>PROCESSING...</formProcessingText>

       

       

      <smtpServer>localhost</smtpServer>

       

       

      <smtpPort>25</smtpPort>

       

       

      <plainText>true</plainText>

       

       

      <emailFromSource>1</emailFromSource>

       

       

      <subjectSource>Contact Form from your site</subjectSource>

       

      </contactFormConfiguration>

       

       

      Here is my webformmailer.php

       

      <?php

       

      $mail_body = '';

       

      //-----------------Getting data sent by flash---------------------

      foreach ($_POST as $key => $value){

       

      if ($key != 'mail_to' && $key != 'smtp_server' && $key != 'smtp_port' &&  $key != 'mail_subject' && $key != 'plain_text'){

       

      $mail_body .= '<b>'.str_replace('_',' ',$key).'</b>:<br/>';

       

      $mail_body .= ''.stripslashes($value).'<br/>';

      }

      }

      //-----------------------------------------------------------------

       

       

       

      $message = '<html><body>'.$mail_body.'</body></html>'; //  mail body

       

      //------------if plain text is set to true removing html tags------

      if ($_POST['plain_text']=='true') {

       

      $message = str_replace('<br/>',"\r\n", $message);

       

      $message = strip_tags($message);

       

      //------------------------------------------------------------------

      } else {

      //----otherwise composing message headers---------------------------

      $headers  = 'MIME-Version: 1.0' . "\r\n";

       

      $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

      //------------------------------------------------------------------

      }

       

      //------------setting conf data-------------------------------------

      $to = $_POST['mail_to'];

       

      $from = $_POST['mail_from'];

       

      $subject = $_POST['mail_subject'];

       

      $smtp_server = $_POST['smtp_server'];

       

      $smtp_port = $_POST['smtp_port'];

      //------------------------------------------------------------------

       

      //---------setting header info--------------------------------------

      $headers .= 'From: ' .$from. "\r\n";

      //------------------------------------------------------------------

       

       

      if (mail($to, $subject, $message, $headers)){ // sending mail

       

      print('<serverResponse><mail>1</mail></serverResponse>');

       

      } else {

       

      print('<serverResponse><mail>0</mail></serverResponse>');

       

      }

       

      ?>

       

      The hosting site did say that I should use this code for my form but it doesn't work or I don't know how to modify the code

       

      <form action="/webformmailer.php" method="post">
      <input type="hidden" name="subject" value="Submission" />
      <input type="hidden" name="redirect" value="thankyou.html" />
      First Name: <input type="text" name="FirstName" />
      Last Name :<input type="text" name="LastName" />
      Email: <input type="text" name="email" />
      Comments: <textarea name="comments" cols="40" rows="10">
      Type comments here.</textarea>
      <input type="submit" name="submit" value="submit"/>
      <input type="hidden" name="form_order" value="alpha"/> <input type="hidden" name="form_delivery" value="hourly_digest"/> <input type="hidden" name="form_format" value="html"/> </form>