problem with a mail form.

  • delta1
  • Newbie
  • Newbie
  • delta1
  • Posts: 6

Post 3+ Months Ago

Ok this is supposed to work by clicking on it and a litte submission form pops up and the surfer can just fill in their information and click submit. ((pretty standard stuff))

But I can't get mine to work and again I'm missing the obvious. (I always do)

Here is the code for the page it sits in.

Code: [ Select ]
<?php
/* CATCHING VALUES */

include 'classes/t-sixty-nine.php';
$tsixty_nine= new tsixtynine();
if(isset($_POST['subject']) && isset($_POST['fullname']) && isset($_POST['address']) && isset($_POST['email'])&&isset($_POST['message']))
{
    $subject=$_POST['subject'];
    $fullname=$_POST['fullname'];
    $address=$_POST['address'];
    $email=$_POST['email'];
    $message=$_POST['message'];
    
    $send_message='Subject :'.$subject."\n\n".
             'Name  :'.$fullname."\n".
             'Adress :'.$address."\n\n".
             "-------------------------------------------------------------------------------\n".
             $message;
    if($subject!="")
    {
        $sending_message=$tsixty_nine->send_mail($email, $send_message, $subject);
    }
}
else
{
    $subject="";
    $fullname="";
    $address="";
    $email="";
    $message="";
}
unset($_POST);


?>
  1. <?php
  2. /* CATCHING VALUES */
  3. include 'classes/t-sixty-nine.php';
  4. $tsixty_nine= new tsixtynine();
  5. if(isset($_POST['subject']) && isset($_POST['fullname']) && isset($_POST['address']) && isset($_POST['email'])&&isset($_POST['message']))
  6. {
  7.     $subject=$_POST['subject'];
  8.     $fullname=$_POST['fullname'];
  9.     $address=$_POST['address'];
  10.     $email=$_POST['email'];
  11.     $message=$_POST['message'];
  12.     
  13.     $send_message='Subject :'.$subject."\n\n".
  14.              'Name  :'.$fullname."\n".
  15.              'Adress :'.$address."\n\n".
  16.              "-------------------------------------------------------------------------------\n".
  17.              $message;
  18.     if($subject!="")
  19.     {
  20.         $sending_message=$tsixty_nine->send_mail($email, $send_message, $subject);
  21.     }
  22. }
  23. else
  24. {
  25.     $subject="";
  26.     $fullname="";
  27.     $address="";
  28.     $email="";
  29.     $message="";
  30. }
  31. unset($_POST);
  32. ?>


This is the actual mail form

Code: [ Select ]
<div class="highslide-maincontent">
<div id="form-container">
  <form name="mail-form" id="mail-form" method="post" action="<?php $_SERVER['PHP_SELF'];?>">
      <table>
    <tr>
    <td>Le sujet</td><td> : <input type="text" name="subject" id="subject value="" class="input-text"></td>
    </tr>
    <tr>
    <td>Votre nom</td><td> : <input type="text" name="fullname" id="fullname" value="" class="input-text"></td>
    </tr>
    <tr>
    <td>Lieu</td><td> : <input type="text" name="address" id="address" value="" class="input-text"></td>
    </tr>
    <tr>
    <td>Courriel</td><td> : <input type="text" name="email" id="email" value="" class="input-text"></td>
    </tr>
    <tr>
    <td colspan="2">Message</td>
    </tr>
    <tr>
    <td colspan="2" align="right">
      <textarea rows="5" name="message" id="message" cols="50"></textarea>
    </td>
    </tr>
    <tr>
    <td colspan="2" align="right">   
          <input type="submit" name="sendmail" value="Send" class="input-button"/>
      </td>
    </tr>
      </table>
  </form>
</div>
</div>
  1. <div class="highslide-maincontent">
  2. <div id="form-container">
  3.   <form name="mail-form" id="mail-form" method="post" action="<?php $_SERVER['PHP_SELF'];?>">
  4.       <table>
  5.     <tr>
  6.     <td>Le sujet</td><td> : <input type="text" name="subject" id="subject value="" class="input-text"></td>
  7.     </tr>
  8.     <tr>
  9.     <td>Votre nom</td><td> : <input type="text" name="fullname" id="fullname" value="" class="input-text"></td>
  10.     </tr>
  11.     <tr>
  12.     <td>Lieu</td><td> : <input type="text" name="address" id="address" value="" class="input-text"></td>
  13.     </tr>
  14.     <tr>
  15.     <td>Courriel</td><td> : <input type="text" name="email" id="email" value="" class="input-text"></td>
  16.     </tr>
  17.     <tr>
  18.     <td colspan="2">Message</td>
  19.     </tr>
  20.     <tr>
  21.     <td colspan="2" align="right">
  22.       <textarea rows="5" name="message" id="message" cols="50"></textarea>
  23.     </td>
  24.     </tr>
  25.     <tr>
  26.     <td colspan="2" align="right">   
  27.           <input type="submit" name="sendmail" value="Send" class="input-button"/>
  28.       </td>
  29.     </tr>
  30.       </table>
  31.   </form>
  32. </div>
  33. </div>


And this is the class :

Code: [ Select ]
function send_mail($from, $message, $subject)
 {
     $toaddress='infoxxxxxxx xx';
     if(mail($toaddress,$subject,$message))
          {return '1';}
     else
     {
         return '2';
     }
 }
}



?>
  1. function send_mail($from, $message, $subject)
  2.  {
  3.      $toaddress='infoxxxxxxx xx';
  4.      if(mail($toaddress,$subject,$message))
  5.           {return '1';}
  6.      else
  7.      {
  8.          return '2';
  9.      }
  10.  }
  11. }
  12. ?>
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 159 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.