Help with html / php contact form

Hi guys I was hoping to get some help with a contact form on my website, to be honest I havent a clue about php but kind of okay with html thats why the php code is just a copy and paste from some website, just trying to marry it up with the html but getting errors.
Hopfully one of you can see the problem.
Error on Submitting:
Notice: Undefined variable: name in \\nas44ent\Domains\g\gethinhayman.co.uk\user\htdocs\send_form_email.php on line 69
Notice: Undefined variable: message in \\nas44ent\Domains\g\gethinhayman.co.uk\user\htdocs\send_form_email.php on line 75
We are very sorry, but there were error(s) found with the form you submitted. These errors appear below.
The Name you entered does not appear to be valid.
The Comments you entered do not appear to be valid.
HTML Code:
<section id="contact" class="four">
                                                            <div class="container">
                                                                      <header>
                                                                                <h2>Contact</h2>
                                                                      </header>
                                                                      <form method="post" action="send_form_email.php">
                                                                                <div class="row half">
                                                                                          <div class="6u"><input type="text" class="text" name="name" placeholder="Name" /></div>
                                                                                          <div class="6u"><input type="text" class="text" name="email" placeholder="Email" /></div>
                                                                                </div>
                                                                                <div class="row half">
                                                                                          <div class="12u">
                                                                                                    <textarea name="message" placeholder="Message"></textarea>
                                                                                          </div>
                                                                                </div>
                                                                                <div class="row">
                                                                                          <div class="12u">
                                                                                                    <a href="http://www.mywebsite.co.uk/email_form.php" class="button submit">Send Message</a>
                                                                                          </div>
                                                                                </div>
                                                                      </form>
                                                            </div>
                                                  </section>
php Code:
<?php
if(isset($_POST['email'])) {
    $email_to = "my email address";
    $email_subject = "Mail from Site";
    function died($error) {
        // your error code can go here
        echo "We are very sorry, but there were error(s) found with the form you submitted. ";
        echo "These errors appear below.<br /><br />";
        echo $error."<br /><br />";
        echo "Please go back and fix these errors.<br /><br />";
        die();
    // validation expected data exists
    if(!isset($_POST['name']) ||
        !isset($_POST['email']) ||
        !isset($_POST['message'])) {
        died('We are sorry, but there appears to be a problem with the form you submitted.');      
    $first_name = $_POST['name']; // required
    $email_from = $_POST['email']; // required
    $comments = $_POST['message']; // required
    $error_message = "";
    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
  if(!preg_match($email_exp,$email_from)) {
    $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
    $string_exp = "/^[A-Za-z .'-]+$/";
  if(!preg_match($string_exp,$name)) {
    $error_message .= 'The Name you entered does not appear to be valid.<br />';
  if(strlen($message) < 1) {
    $error_message .= 'The Comments you entered do not appear to be valid.<br />';
  if(strlen($error_message) > 0) {
    died($error_message);
    $email_message = "Form details below.\n\n";
    function clean_string($string) {
      $bad = array("content-type","bcc:","to:","cc:","href");
      return str_replace($bad,"",$string);
    $email_message .= "Name: ".clean_string($name)."\n";;
    $email_message .= "Email: ".clean_string($email)."\n";
    $email_message .= "Message: ".clean_string($message)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers); 
?>
<?php
?>

PHP CODE:  SaveAs send_form_email.php
<?php
if(isset($_POST['email'])) {
    // EDIT THE 2 LINES BELOW AS REQUIRED
    $email_to = "[email protected]";
    $email_subject = "Your email subject line";
    function died($error) {
        // your error code can go here
        echo "We are very sorry, but there were error(s) found with the form you submitted. ";
        echo "These errors appear below.<br /><br />";
        echo $error."<br /><br />";
        echo "Please go back and fix these errors.<br /><br />";
        die();
    // validation expected data exists
    if(!isset($_POST['name']) ||
        !isset($_POST['email']) ||
        !isset($_POST['message'])) {
        died('We are sorry, but there appears to be a problem with the form you submitted.');     
    $name = $_POST['name']; // required
    $email_from = $_POST['email']; // required
    $comments = $_POST['message']; // required
    $error_message = "";
    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
  if(!preg_match($email_exp,$email_from)) {
    $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
    $string_exp = "/^[A-Za-z .'-]+$/";
  if(!preg_match($string_exp,$name)) {
    $error_message .= 'The Name you entered does not appear to be valid.<br />';
  if(strlen($message) < 2) {
    $error_message .= 'The message you entered does not appear to be valid.<br />';
  if(strlen($error_message) > 0) {
    died($error_message);
    $email_message = "Form details below.\n\n";
    function clean_string($string) {
      $bad = array("content-type","bcc:","to:","cc:","href");
      return str_replace($bad,"",$string);
    $email_message .= "Name: ".clean_string($name)."\n";
    $email_message .= "Email: ".clean_string($email_from)."\n";
    $email_message .= "Message: ".clean_string($message)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
<!-- include your own success html here -->
Thank you for contacting us. We will be in touch with you very soon.
<?php
?>
HTML Code -- save as html page.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Contact Form</title>
</head>
<body>
<section id="contact" class="four">
<div class="container">
<header>
<h2>Contact</h2>
</header>
<form method="post" action="send_form_email.php">
<div class="row half"> <div class="6u">
<input type="text" class="text" name="name" placeholder="Name" />
</div>
<div class="6u">
<input type="text" class="text" name="email" placeholder="Email" />
</div>
</div>
<div class="row half"> <div class="12u">
<textarea name="message" placeholder="Message"></textarea>
</div>
</div>
<div class="row">
<div class="12u">
<input type="submit" name="submit" value="Send">
</div>
</div>
</form>
</div>
</section>
</body>
</html>
Upload both to your Apache server to test.
EDIT:  changed typo on Submit button -- valuse to value.
Nancy O.

Similar Messages

  • Can anyone help with my PHP contact form please!

    Hi all,
    I've just implemented the email contact form as described in the PHP Solutions book by David Powers and it is working fine.
    What I'm having problems with is my form is at the bottom of a long page and you have to scroll or click a link to get to it, which means that when the submit button is pressed, whether the form is successfully submitted or a field hasn't been completed, the user ends up back at the top of the page having to scroll back down to the form before they can see the feedback (either thanking them for submitting or pointing out that they have tried to submit an incomplete form).
    Can anyone tell me how I can make the page redirect upon clicking submit so that the user returns to the part of the page where the form is so they can see the feedback instead of going to the top of the page where the form is out of view.
    Many thanks,
    Karl.

    I've attached the entire code from the page plus the css so you can see what's going on and in additiion I've put in the corefuncs.php include code.
    Hope that's enough, thanks for looking.
    Cheers,
    Karl.
    <?php
    include('includes/corefuncs.php');
    if (function_exists('nukeMagicQuotes')) {
    nukeMagicQuotes();
    // process the email
    if (array_key_exists('send', $_POST)) {
    $to = '[email protected]'; // use your own email address
    $subject = 'Feedback from my form page';
    // list expected fields
    $expected = array('name', 'email', 'comments');
    // set required fields
    $required = array('name', 'email', 'comments');
    // create empty array for any missing fields
    $missing = array();
    // assume that there is nothing suspect
    $suspect = false;
    // create a pattern to locate suspect phrases
    $pattern = '/Content-Type:|Bcc:|Cc:/i';
    // function to check for suspect phrases
    function isSuspect($val, $pattern, &$suspect) {
         // if the variable is an array, loop through each element
         // and pass it recursively back to the same function
         if (is_array($val)) {
              foreach ($val as $item) {
                   isSuspect($item, $pattern, $suspect);
         else {
         // if one of the suspect phrases is found, set Boolean to true
              if (preg_match($pattern, $val)) {
                   $suspect = true;
    // check the $_POST array and any subarrays for suspect content
    isSuspect($_POST, $pattern, $suspect);
    if ($suspect) {
    $mailSent = false;
    unset($missing);
    else {
    // process the $_POST variables
    foreach ($_POST as $key => $value) {
    // assign to temporary variable and strip whitespace if not an array
    $temp = is_array($value) ? $value : trim($value);
    // if empty and required, add to $missing array
    if (empty($temp) && in_array($key, $required)) {
    array_push($missing, $key);
    // otherwise, assign to a variable of the same name as $key
    elseif (in_array($key, $expected)) {
    ${$key} = $temp;
    // validate the email address
    if (!empty($email)) {
    // regex to ensure no illegal characters in email address
    $checkEmail = '/^[^@]+@[^\s\r\n\'";,@%]+$/';
    // reject the email address if it doesn't match
    if (!preg_match($checkEmail, $email)) {
    array_push($missing, 'email');
    // go ahead only if not suspect and all required fields OK
    if (!$suspect && empty($missing)) {
    // build the message
    $message = "Name: $name\n\n";
    $message .= "Email: $email\n\n";
    $message .= "Comments: $comments";
    // limit line length to 70 characters
    $message = wordwrap($message, 70);
    // create additional headers
    $additionalHeaders = 'From: domain.com Feedback Form<[email protected]>';
    if (!empty($email)) {
    $additionalHeaders .= "\r\nReply-To: $email";
    // send it
    $mailSent = mail($to, $subject, $message, $additionalHeaders, '[email protected]');
    if ($mailSent) {
    // redirect the page with a fully qualified URL
    header('Location: http://www.domain.com/index.php#form-div');
    exit;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Page | title</title>
    <script type="text/javascript" src="jquery.min.js">></script>
    <script type="text/javascript" src="jquery.cycle.all.2.72.js"></script>
    <script type="text/javascript">
    $(function() {
        $('#slideshow').cycle({
            speed:       1400,
            timeout:     8000
    </script>
    <link href="main.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper" class="container">
    <div id="header">
    <h1 class="logo">XXX Xxxx Xxxxx</h1>
    <h2 class="subhead">Xxx Xxxxxxx xxx Xxxxxx Xxxxxxx xx Xxxx xxx Xxxxx.</h2>
    <div id="nav">
    <h2>Need more information?</h2>
    <h3>Look no further...</h3>
    <ul>
      <li><a class="nav-about" href="#about-div">About Us...</a></li>
      <li><a class="nav-contact" href="#contact-div">Contact Us...</a></li>
    </ul>
    </div>
    <!-- end nav -->
    </div><!-- end header -->
    <div id="page-content">
    <div id="cycle">
    <div id="cycle-nav"></div>
    <div id="slideshow" class="pics">
                <img src="im/slides/escape.jpg" border="0" alt="" title="" width="547" height="339" />
                <img src="im/slides/old-lady.jpg" border="0" alt="" title="" width="547" height="339" />
                <img src="im/slides/gouge.jpg" border="0" alt="" title="" width="547" height="339" />
                <img src="im/slides/disarm.jpg" border="0" alt="" title="" width="547" height="339" /></div><!-- slideshow -->
    </div><!-- cycle -->
    <div id="right-column">
    <div id="ladies">
    <h1>Xxxxxx xxx'x xxx xxxxx xxxx xxxx.</h1>
    <p>Xxxx xxxxxxxxx xxxx XXX xxxxx xxxxxxxxxx xxx xxxx xxxx xxxx xxxx!</p>
    <p class="bottom">XXXX XX xx xxxx xxx xxxx...</p>
    </div>
    <div id="courses">
         <div id="course1">
          <h2 class="top"><strong>Xxxx Xxxx Xxxxxxx Xxxxxx Xxxxxxx</strong></h2>
        <p>XXX Xxxx Xxxx Xxxxxxx xxxxxx xxx x xxxx-xxxx xxxxxxxx xxx xx xxxx xxxx xxxxx xxx xxxxxx.</p>
        <p><strong>XXXXX:</strong> XXX.XX xxx xxxxxx.</p>
        <p><strong>XXXX XXXXXX:</strong><br />
        Xxxxxx Xxx Xxxx<br /><strong>[XXXXXX XXXXXXXXX]</strong></p>
        <ul><strong>XXXXXX XXXXXXX:</strong>
    <li>Xxxxxx Xxx Xxxxxxxxx</li>
    <li>Xxxxxx Xxx Xxxxxxxx</li>
    <li>Xxxxxx Xx Xxxxxxx -XXXX</li>
    </ul>
        <h2>Xxxx Xxxxx...</h2>
        <p class="book-early">Xx xxxxx xxx xx xx xxxxxxxx xxxxxxx xxx xxx xxxxxxx xxx xxxxx xxxxxxxxxx xx x xxxxxxx xxxxxxx xxxxxxxx xx xxx xxxx xxx xxxxxxxxx xxxxxx xxxx xx xxxxx xx xxxxxxx xx xxx xxx xxxxxxxx xx xxxxxxxxx xx xxxxxx.</p>
        <h2><strong>Xxxxxxxxx xx xxx Xxxxxx</strong></h2>
        <p class="location">      XX. Xxxxxx Xxxx, <br />
          Xxx Xxxxxxxxx Xxxxxx, Xxxxxxxx Xxxx, Xxxx (xxxxx xxx xxxx xx xxxx).<br />
          Xxxxxxxx xx xxxxxxxxxxx xxxx xxxxxxxx Xxxx.</p>
        <h2><strong>Xxxxxxxxx xx xxx Xxxxxx</strong></h2>
        <p class="structure"><strong>Xxxxxxx xxxxxxx:</strong><br />
          XX.XXxx – XX.XX xx<br />
          <strong>Xxxxx xxxxx:</strong><br />
          XX xxxx.<br />
          Xxxxxx xxxxxxx xxxx xxx xxxxxx Xxxxx.<br />
          <strong>Xxxxxxxxxx xxxxxxx:</strong><br />XX.XXxx – X.XXxx</p>
        <h2><strong>Xxxxxx Xxxx...</strong></h2>
        <p class="news">Xxxxx xxxx xxxxx xxx xxxx xxxxx xxx Xxxx Xxxx Xxxxxxx Xxxxxx.<br />
        </p>
      </div>
      <div class="to-top">
      <p><a href="#header">[Back to Top]</a></p>
      </div>
         <div id="course2">
          <h2 class="top"><strong>Xxxxx Xxxx Xxxxxxx Xxxxx Xxxxxxx</strong></h2>
          <p>Xxx XXX XXXXX Xxxx Xxxxxxx Xxxxx xxx x xxx-xxxx xxxxxxxx xxx xx xxxx xxxxxx.</p>
        <p><strong>XXXXX:</strong> XX.XX xxx xxxxxx</p>
        <p><strong>XXXX XXXXX:</strong><br /> 
        Xxxxxx XXxx Xxx<br /><strong>[XXXXXX XXXXXXX]</strong></p>
        <ul><strong>XXXXXX XXXXXXX:</strong>
    <li>Xxxxxx Xxx Xxxx</li>
    <li>Xxxxxx Xxx Xxxx</li>
    <li>Xxxxxx Xxx Xxxx</li>
    <li>Xxxxxx Xxx Xxxx</li>
    </ul>
        <h2>Xxxx Xxxxx...</h2>
        <p class="book-early">Xx xxxxx xxx xx xx xxxxxxx xxxxxxx xxx xxx xxxxxxx xxx xxxxx xxxxxxxxxx xx x xxxxxxxxx xxxxxxx xxxxxxxx xx xxx xxxx xxx xxxxxxxxx xxxxxx xxxx xx xxxxx xx xxxxxxx xx xxx xxx xxxxxxxxxx xx xxxxxxxxx x xxxxxx.</p>
        <h2><strong>Xxxxxxxxx xx xxx Xxxxx</strong></h2>
        <p class="location">Xxxxxxxxx Xxxx, Xxxxxx Xxxxxx, Xxxxx, (xxx xxxxxxx xxxxxxxxx xx -<br />
          Xxxxxxx xx xxxxxxxxxx xxxx - </p>
        <h2><strong>Xxxxs Xxxx...</strong></h2>
        <p class="news">Xxxxx xxxx xxxxx xxx xxxx xxxxx xxx Xxxxx Xxxx Xxxxxxx Xxxxx.<br />
        </p>
      </div><!-- Course 2 end -->
      <div class="to-top">
      <p><a href="#header">[Back to Top]</a></p>
      </div>
    </div><!-- Courses end -->
    </div><!-- end right column -->
    <div id="main-content" >
    <div id="main-content-1" class="clearfix">
    <h2>Xxxxxxx xx xxx Xxxx Xxxxxxx<br />
    xxxxxxx xxxx xxx XXX.</h2>
    <h3>Xxxxxx xxx Xxxxx xxxxxxx…</h3>
    <p>Xxx XXX xx xx xxxxxxxxxxx xxxxx xxxxxx xxxxxxx xx xxxx xxxxxxx xx Xxxx xxx Xxxxx - Xxxx Xxxxxxxxx, xxxxxx xxxxxxxxx xx xxxxx xxxxxx xxx xxxxxx xxxxxx,   xxx xxxxxxxx x xxxx xxxxxxx xx xxxxxx xxxxxxxxx xx xxxxxxxx xxxx xxxxxxx.</p>
    <p>Xxx XXX xxxxxx xxx xxxxxxx xxx xxxxxxxx Xxxx Xxxxxxx xx xxx Xxxx / Xxxxx xxxx xx Xxxx Xxxxxxxxx.</p>
    <p>Xxx xxxxx xxxxxx xx x xxx xxx Xxxx Xxxxxxx Xxxxxx xxxx x xxxxxxxx xx xxxxxxxxx xxxx xxxxx xxxxx xx xxxx xx Xxxx xxxx xxxxx xxx xxxxxx xx xxx Xxxxxxxx Xxxxxx.</p>
    <p>Xxx xxxxxx xxxxxx xx x xxxxxx Xxxx Xxxxxxx Xxxxx xxxxx xx x xxx xxxx xxxxxxx xxx xx xxxx xx xxx xxxxxx xx xxxxx xx Xxxxxxxx Xxxx xx xxxxx Xxxxx Xxxxxx. Xxxxxxxx xxx xx xxxxx xx xxxx xxxxx.</p>
    <h3 class="extra-padding">Xxx xx xx xxx xxx xxxx xxxx xxx xxxxx?</h3>
    <p>Xxxx xxxxxx xx xxxxxxxxxx xxxxxx xx xxxxxx xxx xxx xxxx xxxxxx xxxxxxx xxx xxxx xxxxxx xx xx xxx xxxxxxxxxx xxx xxxx xx xxxx xx xx xxxxxxx xxxxxx xxxx xx xxxxxxxx xx xxxxxxxx xxxx xx xxxxxx xxxxxxxxxx xxxxxxx xxx xxxxxx xx xxxxx xxxxxxxx.</p>
    <p>xxx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx.</p>
    <p>xxx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx.</p>
    <p>xxx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx.</p>
    <p><strong>xxx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx.</strong></p>
    <p>xx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx.</p>
    <p>xx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx.</p>
    <p><strong>Xxxx xxxx xx xxxxxx xxxx xx xxxxxx xxxxxxxxxx, xx x xxxxxxxx xxx xxxxxxx xxxxxxxxxxx xxxxx xxxxxx xxxxxxxxx xxx xxxx xxxx xx xxxxxxxxxxx xxxxxx xxxx xx xxxx..</strong></p>
    <h3 class="extra-padding">Xxxxxxx xx…</h3>
    <h4>Xxx xxxxxxxxxx xx xxx Xxxx Xxxx Xxxxxxx Xxxxxx xxxxxxxx xxxx xxxxxx xxxx</h4>
    <h4>Xxx xxxxxxxxxx xx xxx Xxxx Xxxx Xxxxxxx Xxxxxx xxxxxxxx xxxx xxxxxx xxxx</h4>
    </div>
    <div id="main-content-2" class="clearfix">
      <h4> </h4>
    </div>
    </div><!-- end maincontent -->
    <div id="bottom-content">
    <div id="about-div">
    <h2>Xxxxx xx…</h2>
    <p>Xx, xx xxxxx ixx Xxxxxx Xxxxxxxxx xxxx xxxx xxxx xxxxxxx xxx xxxxxxxx xxxx xxxxxxx xxx xxxx xxxxxx xxxx xxxxx.</p>
    <p>Xx, xx xxxxx ixx Xxxxxx Xxxxxxxxx xxxx xxxx xxxx xxxxxxx xxx xxxxxxxx xxxx xxxxxxx xxx xxxx xxxxxx xxxx xxxxxXx, xx xxxxx ixx Xxxxxx Xxxxxxxxx xxxx xxxx xxxx xxxxxxx xxx xxxxxxxx xxxx xxxxxxx xxx xxxx xxxxxx xxxx xxxxx</p>
    <p>Xx, xx xxxxx ixx Xxxxxx Xxxxxxxxx xxxx xxxx xxxx xxxxxxx xxx xxxxxxxx xxxx xxxxxxx xxx xxxx xxxxxx xxxx xxxxx</p>
    <div class="about-bottom-to-top">
      <p><a href="#header">[Back to Top]</a></p>
      </div>
    </div>
    <hr />
    <div id="links-div">
    <h2>Xxxxxx xxxxx...</h2>
    <ul>
         <li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
        <li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
        <li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
        <li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
        <li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
        <li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
        <li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
        <li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
        <li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
        <li><a href="">Xxx Xxxxx xxxx xxx xxx xxx xx(?)</a></li>
    </ul>
    </div>
    <div id="contact-div">
    <h2>Xxxxxx xxx...</h2>
    <p>Xxxxx x xxxx xxx xxx xxxxxxxxxx xxx xxxxxxx x xxxx xxx xxx xxxxxxxxxx xxx xxx xxxx x xxxx xxx xxx xxxxxxxxxx xxx xxxxxxx x xxxx xxx xxx xxxxxxxxxx xxx xxx<br />
    </p>
    <p class="phone">Xxxxx</p>
    </div>
    <div id="form-div">
         <p>Please make sure you complete all three fields below so that we can reply directly.</p>
         <?php
              if ($_POST && isset($missing) && !empty($missing))
              ?>
              <p class="warning">Please complete the missing item(s) indicated.</p>
              <?php
              elseif ($_POST && !$mailSent) {
              ?>
              <p class="warning">Sorry, there was a problem sending your message.
              Please try later.</p>
              <?php
              elseif ($_POST && $mailSent) {
              ?>
              <p class="thanks"><strong>Your message has been sent. Thank you for your feedback.
              </strong></p>
              <?php } ?>
      <form method="post" id="feedback" class="contactForm" action="">
                                              <label for="name">Name: <?php
                                                 if (isset($missing) && in_array('name', $missing)) { ?>
                                                 <span class="warning">Please enter your name</span><?php } ?>
                                              </label>
                                     <input name="name" id="name" type="text" class="formbox"
                                             <?php if (isset($missing)) {
                                                      echo 'value="'.htmlentities($_POST['name']).'"';
                                             } ?>
                                             />
                                              <label for="email">Email: <?php
                                                 if (isset($missing) && in_array('email', $missing)) { ?>
                                                 <span class="warning">Please enter a valid email address</span><?php } ?>
                                            </label>
                                        <input name="email" id="email" type="text" class="formbox"
                                            <?php if (isset($missing)) {
                                                      echo 'value="'.htmlentities($_POST['email']).'"';
                                            } ?>
                                            />
                                        <label for="comments">Comments: <?php
                                            if (isset($missing) && in_array('comments', $missing)) { ?>
                                            <span class="warning">Please enter your comments</span><?php } ?>
                                            </label>
                                        <textarea name="comments" id="comments" cols="30" rows="10"><?php
                                                 if (isset($missing)) {
                                                      echo htmlentities($_POST['comments']);
                                            } ?></textarea>
                                             <input name="send" id="send" class="formSubmit" type="submit" value="Send message" />
      </form>
       <div class="form-bottom-to-top">
      <p><a href="#header">[Back to Top]</a></p>
      </div>                         
    </div>
    </div>
    <div id="footer">
    <p>Xxxxxxxxxxxxx</p>
    </div>
    </div><!-- wrapper -->
    </div>
    <!-- end page-content -->
    </div><!-- end wrapper -->
    </body>
    </html>
    /* following is the include php code */
    <?php
    function nukeMagicQuotes() {
      if (get_magic_quotes_gpc()) {
        function stripslashes_deep($value) {
          $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
          return $value;
        $_POST = array_map('stripslashes_deep', $_POST);
        $_GET = array_map('stripslashes_deep', $_GET);
        $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
    ?>
    /* Following is the css */
    @charset "UTF-8";
    /* CSS Document */
    html { margin: 0; background: #faf9f2 url(im/background_texture_tile.jpg) top center repeat; text-align: center; }
    body { margin: 0 auto; background: url(im/background_texture_tile.jpg) top center repeat; text-align: center; width: 910px;
    padding: 0; font: 62.5% Arial, Verdana, Helvetica, sans-serif; }
    h1, h2, h3, h4, h5, h6, p, ul, ol, li, dl, dt, dd, form, label, fieldset, legend, blockquote, table { margin: 0; padding: 0; }
    #wrapper {
         text-align: left;     
         position: relative;
    .container{     
         margin: 0 auto 0;
         width: 910px;
    #header {
         width: 870px;
         height: 150px;
         margin: 0 20px 20px 20px ;
         background: url(im/header-bg.gif) top left no-repeat;
    h1.logo {
         float: left;
         height: 130px;
         width: 315px;     
         margin: 0 0 0 50px;
         border: 0;
         outline: 0;
         text-indent:-9999px;
         background:url(im/logo.jpg) 0 10px no-repeat;
         display: inline;
    h2.subhead {
         font-weight: bold;
         font-size: 1.6em;
         line-height: 1.4em;
         color: #999;
         float: right;
         width: 135px;
         text-align: right;
         margin: 25px 320px 0 0;
         display: inline;
    #nav {
         position: absolute;
         top: 0px;
         right: 50px;
         width: 270px;
         height: 277px;
         background: url(im/nav-bg.png) top left no-repeat;
    #nav h2 {
         font-size: 1.6em;
         text-align: center;
         color: #4D98C5;
         margin-top: 35px;
    #nav h3 {
         font-size:2.2em ;
         text-align: center;
         color: #4D98C5;
         padding-bottom: 13px;
         margin: 0 40px 0;
         border-bottom: 4.5px dotted #999;
    #nav ul {list-style:none;}
    #nav li {
    list-style:none;
    font-size: 1.4em;
    font-weight: bold;
    margin: 0 40px 0 40px ;
    border-bottom: 4.5px dotted #999;
    #nav li a {
    text-align: left;
    background-image:url(im/CSSSprite.jpg);
    background-repeat:no-repeat;
    color: #4D98C5;
    text-decoration: none;
    line-height: 65px;
    margin: 10px 0 10px 0;
    #nav li a.nav-about {
    background-position: 105px -15px;
    padding: 20px 95px 20px 0;
    #nav li a.nav-about:hover,
    #nav li a.nav-about:active,
    #nav li a.nav-about:focus {
    background-position: 105px -102px;
    color: #814098;
    #nav li a.nav-contact {
    background-position: 105px -180px;
    padding: 20px 80px 20px 0;
    #nav li a.nav-contact:hover,
    #nav li a.nav-contact:active,
    #nav li a.nav-contact:focus {
    background-position: 105px -267px;
    color: #814098;
    /* Cycle styles */
    #cycle {
         float: left;
         margin-left: 20px;
         margin-bottom: 25px;
         width: 547px;
         height: 339px;
         clear: both;
    .pics { height: 339px; width: 547px; padding:0; margin:0; overflow: hidden; border: 1px solid #814098; }
    /* End cycle styles */
    /*///// RIGHT CONTENT ////*/
    #right-column {
         float: right;
         width: 260px;
         margin: 0 53px 0 0;
         display: inline;
    #ladies {
         width: 252px;
         height: 437px;
         background: url(im/pink-ladies.png) top left no-repeat !important ;
         background: url(im/pink-ladies.gif) top left no-repeat ;
         margin: 120px 0 0 6px;
    #ladies h1 {
         margin: 0px 30px 150px 20px;
         padding-top: 60px;
         font: bold 2em Georgia, "Times New Roman", Times, serif;
         text-align: center;
         color: #6A437E;
    #ladies p {
         margin: 0px 30px 15px 20px;
         font: normal 1.8em Georgia, "Times New Roman", Times, serif;
         text-align: center;
         line-height: 1.4em;
         color: #EF4358;
    #ladies p.bottom {
         margin: 0px 30px 0px 20px;
         font: bold 2.2em Helvetica, Arial, sans-serif;
         text-align: center;
         color: #6A437E;
    #courses{
         margin-top: 15px;
         margin-bottom: 18px;
    #courses h2 {
         letter-spacing: .07em;
    /*Hull Course */
    #course1 {
         margin: 0 0 5px 6px ;
         width:240px;
         background:url(im/rightnav.gif) bottom left no-repeat;
    #course1 h2.top {
         background:url(im/rightnaw.gif) top left no-repeat;
         margin:0;
         padding:15px;
         color:#FFFFFF;
         font-size:1.6em;
         line-height: 1.4em;
         font-weight: bold;
         text-transform:uppercase;
    #course1 h2 {
         font-size:1.6em;
         line-height: 1.4em;
         color:#FFFFFF;
         background-color:#814198;
         padding:15px;
         text-transform:uppercase;
    #course1 p {
         font-size:1.4em;
         line-height:1.4em;
         padding: 15px 15px 0 15px;
         margin:0;
    #course1 p a {
         text-decoration:underline;
         font-weight:bold;
         color: #9f1f63     
    #course1 p a:hover {
         color: #ec008c;
    #course1 ul {
         margin: 20px 0 20px 15px;
         font-size:1.4em;
         line-height: 1.6em;
         list-style: none;
    #course1 p.book-early {
         padding-bottom: 20px;
    #course1 p.location {
         padding-bottom: 30px;
    #course1 p.structure {
         padding-bottom: 30px;
    #course1 p.news {
         padding-bottom: 30px;
    #right-column .to-top {
         color: #000;
         text-align: right;
         padding-right: 27px;
         margin-bottom: 40px;
    #right-column .to-top a, a:link {
         color: #000;
         font-size: 1.3em;     
         text-decoration: none;
    #right-column .to-top a:hover {
         text-decoration: underline;
    #course2 {
         margin: 0 0 5px 6px ;
         width:240px;
         background:url(im/rightnav.gif) bottom left no-repeat;
    #course2 h2.top {
         background:url(im/rightnaw.gif) top left no-repeat;
         margin:0;
         padding:15px;
         color:#FFFFFF;
         font-size:1.6em;
         line-height: 1.4em;
         font-weight: bold;
         text-transform:uppercase;
    #course2 h2 {
         font-size:1.6em;
         line-height: 1.4em;
         color:#FFFFFF;
         background-color:#814198;
         padding:15px;
         text-transform:uppercase;
    #course2 p {
         font-size:1.4em;
         line-height:1.4em;
         padding: 15px 15px 0 15px;
         margin:0;
    #course2 p a {
         text-decoration:underline;
         font-weight:bold;
         color: #9f1f63     
    #course2 p a:hover {
         color: #ec008c;
    #course2 ul {
         margin: 20px 0 20px 15px;
         font-size:1.4em;
         line-height: 1.6em;
         list-style: none;
    #course2 p.book-early {
         padding-bottom: 20px;
    #course2 p.location {
         padding-bottom: 30px;
    #course2 p.news {
         padding-bottom: 30px;
    /*///// RIGHT CONTENT ////*/
    #main-content {
         margin: 0 360px 0 40px;
         padding: 0;
    #main-content-1 {
         width: 510px;
    #main-content-2 {
         width: 510px;
    #main-content p {
         font-family: Arial, Verdana, Helvetica, sans-serif;
         font-size: 1.6em;
         line-height: 1.4em;
         padding-bottom: 1em;
         color: #666;
    #main-content h2{
         padding: 0 0 20px 0;
         margin: 0;
         font-family: Arial, Verdana, Helvetica, sans-serif;
         font-size: 3em;
         color: #666;
    #main-content h3 {
         font-size: 2.3em;
         color: #666;
         font-weight: normal;
         padding-bottom: 0.8em;
    #main-content h3.extra-padding {
         padding-top: 0.8em;
         padding-bottom: 0.8em;
    #main-content h4 {
         font-size: 2em;
         font-weight: normal;
    #bottom-content {     
         background-color: #814098;
         clear: both;
         margin: 0 20px;
         width: 870px;
         float: left;
    #bottom-content h2 {
         font-family: Arial, Verdana, Helvetica, sans-serif;
         font-size: 2.6em;
         letter-spacing: .05em;
         color: #FFF;
         font-style: normal;
         padding: 0 0 15px 0;
    #bottom-content p {
         color: #FFF;     
    #about-div {
         padding: 0 320px 30px 0;
         background: url(im/sheila.png) 560px 20px no-repeat !important;
         background: url(im/sheila.jpg) 560px 20px no-repeat ;
    #about-div h2 {
         padding: 20px 28px 15px 28px;
    #about-div p {
         padding: 0 28px 20px 28px;
         font-size: 1.5em;
         line-height: 1.4em;
    .about-bottom-to-top {
         position: relative;
         top: 65px;
         right: -320px;
         text-align: right;
         padding-right: 33px;
         font-size: .68em;     
    .about-bottom-to-top a, a:link {
         color: #FFF;
         text-decoration: none;
    .about-bottom-to-top a:hover {
         text-decoration: underline;
    hr {
           margin: 40px 28px 20px 28px;
           color: #C09FCB;
           border-top: 1px black solid;
    #links-div {
         margin: 0 15px 0px 28px;
         float: left;
         width: 254px;
    #links-div li {
         list-style: none;
         padding: 0 0;
    #links-div li a {
         font-size:1.5em;
         line-height: 1.5em;
         text-decoration: none;
         color: #FFF;
    #links-div li a:hover {
         text-decoration: underline;
    #contact-div {
         margin: 0 10px 0 0;
         width: 254px;
         float: left;
    #contact-div p {
         font-size: 1.5em;
         line-height: 1.4em;
    #contact-div p.phone {
         font-size: 2.2em;
         font-weight: bold;
         letter-spacing: .05em;
    /* CONTACT FORM */
    #form-div {
         margin: 0 28px 50px 0 ;
         float: right;
         width: 281px;
    #form-div .contactForm {
         padding:6px;
    #form-div .contactForm .formbox {
         font-family: Arial, Verdana, Helvetica, sans-serif;
         font-size:1.2em;
         color:#333;
         width:261px;
         padding:5px 3px;
         margin:0 0 5px 0 ;
         border:1px solid #666;
         border-top-color:#000;
         background:#fff url(im/contact-input.gif) top repeat-x;
    #form-div .contactForm #comments {
         font-family: Helvetica, Arial, sans-serif;
         font-size:1.23em;
         color:#333;
         line-height: 1.5em;
         width:258px;
         padding: 5px 0.4em 0 0.4em ;
         margin: 0 0 10px 0 ;
         display:block;
         clear:both;
         border:1px solid #666;
         border-top-color:#000;
         background:#fff url(im/contact-textarea.gif) top repeat-x;
    .formSubmit {
         display:block;
         clear:both;
         width:110px;     
         height:25px;
         padding:0;
         border:none;
         background-color: #251149;
         text-align:center;
         font-size:1.2em;
         color:#fff;
         cursor:pointer;
    .formSubmit:hover {
         background-color: #E76F34;
    .form-bottom-to-top {
         text-align: right;
         padding-right: 33px;
         font-size: 0.68em;     
         margin-top: 40px;
    .form-bottom-to-top a, a:link {
         color: #FFF;
         text-decoration: none;
    .form-bottom-to-top a:hover {
         text-decoration: underline;
    /* David Powers styles */
    .warning {
        font-weight: bold;
         font-size: 1em;
        color: #FCCCB9;
         display: block;
    .thanks {
        font-weight: bold;
        color: #f00;
         margin-left: 3px;
    #form-div p {
        margin: 0 0 10px 8px ;
         font-size: 1.5em;
         line-height: 1.4em;
    label {
        font-weight: bold;
         font-size: 1.6em;
        color: #FFF;
        display: block;
    /* END CONTACT FORM */
    #footer {
         height: 10em;
         background-color: #FFF;
         margin: 0 20px;
         clear: both;
    #footer p {
         font-size: 1.4em;
         color: #666;
         padding: 40px 0 30px 120px;     
         background: url(im/footer-logo.gif) 50px 20px no-repeat ;
    .clearfix:after{ content:"."; display:block; height:0; clear:both; visibility:hidden; }
    .clearfix {display: inline-block;}
    /* Hide from IE Mac \*/
    .clearfix {display:block;}
    /* End hide from IE Mac */
    * html .clearfix{ height: 1px; }

  • Help with a simple contact form.

    Hi there..
    I am having trouble making a contact form with a servlet. I have a Fedora Core Linux Box running ddns..
    My internet account is sympatico.. which a username and password is required to send out with smtp..
    I need help creating a servlet and I have java mail also..
    This is what I have so far...
    I have more info below
    <form class="formContactus1" name="formContactus1" method="post" action="/SendMail" onsubmit="validerForm();">
                                                      <table id="tblContactus">
                                                           <tbody><tr>
                                                                <td class="tdLeft">
                                                                     <label><fmt:message key="Form_firstname" /></label>
                                                                </td>
                                                                <td class="tdRight">
                                                                     <input class="contactTextName" id="last_name" name="last_name" maxlength="100" type="text">
                                                                </td>
                                                           </tr>
                                                           <tr>
                                                           <td class="tdLeft">
                                                                <label><fmt:message key="Form_lastname" /></label>
                                                           </td>
                                                           <td class="tdRight">
                                                                <input class="contactTextName" id="first_name" name="first_name" maxlength="75" type="text">
                                                           </td>
                                                      </tr>
                                                      <tr>
                                                           <td class="tdLeft">
                                                                <label><fmt:message key="Form_email" /></label>
                                                           </td>
                                                           <td class="tdRight">
                                                                <input class="contactTextName" id="email" name="email" maxlength="75" type="text">
                                                           </td>
                                                      </tr>
                                                           <tr>
                                                                <td class="tdLeft" valign="top">
                                                                     <label><fmt:message key="Form_message" /></label>
                                                                </td>
                                                                <td>
                                                                     <textarea class="contactTextMessage" id="message" cols="" rows="" name="message"></textarea>
                                                                </td>
                                                           </tr>
                                                      </tbody></table>
                                                      <!-- This is the anti-spam validation images... -->
                                                      <table id="tblCaptcha">
                                                           <tbody><tr>
                                                                <td class="right" id="tdImgCaptcha"><img style="height: 35px;" src="/captcha/img"></td>
                                                                <td class="right" id="tdInputCaptcha"><input name="captchaAnswer" type="text"></td>
                                                           </tr>
                                                           <tr>
                                                                <td class="right" colspan="2" valign="bottom">
                                                                     <input id="contactSubmit" name="send" value="<fmt:message key="Form_submit" />" type="submit">
                                                                </td>
                                                           </tr>
                                                      </tbody></table>
                                                 </form>

    You forgot to tell the details about the trouble. Please elaborate. What happens? What happens not?
    Please also read this how to ask questions the smart way: [http://www.catb.org/~esr/faqs/smart-questions.html].

  • Need help with creating a contact form!

    I searched the forum, and found the suggestion to go to Bravenet and create the form, and then copy the code into the HTML snippet.
    I've done that - but I need to change the font - along with its color and possibly the size.
    Here is the code:
    <form method="post" enctype="multipart/form-data" action="http://pub5.bravenet.com/emailfwd/senddata.php">
    <input type="hidden" name="usernum" value="381593922">
    <input type="hidden" name="cpv" value="2">
    <!-- DO NOT CHANGE OR REMOVE THE 3 TAGS ABOVE THIS COMMENT-->
    <table border="0" cellpadding="0" cellspacing="0" align="center">
    <tr>
    <td>
    Contact Form
    </td>
    </tr>
    <tr>
    <td>
    <label for="FirstLastName" style="float:left;width:140px;">First and Last Name:</label><input type="text" name="FirstLastName" id="FirstLastName" value="" maxlength="" style="width:200px;">
    <label for="Email" style="float:left;width:140px;">E-Mail Address:</label><input type="text" name="Email" id="Email" value="" maxlength="" style="width:200px;">
    <label for="Message" style="float:left;width:140px;">Message:</label><textarea name="Message" id="Message" maxlength="" style="width:200px;height:200px;"></textarea>
    </td>
    <tr>
    <td align="right">
    <!-- YOU CAN MODIFY THE TEXT WITHIN VALUE="" TO MODIFY YOUR BUTTON TEXT-->
    <input type="submit" value=" Submit "> <input type="reset" value=" Reset ">
    </td>
    </tr>
    </table>
    </form>
    Can anyone give me a hand??
    Thanks!
    Kim

    You might want to check out wufoo.com - very customizable

  • Help with ActionScript/PHP email form

    Hey guys, hope someone can help me out with this!
    Haven't programmed in a while, but a friend asked me to look
    at this and figure out why it isn't working. It's a simple form,
    with the text boxes labeled inTxt_1, inTxt_2 ..... inTxt_13.
    The ActionScript looks like this ...
    Code:
    submit.onRelease = function () {
    var loadv = new LoadVars();
    loadv._level0.mc1.inTxt_1 = _level0.mc1.inTxt_1.text;
    loadv._level0.mc1.inTxt_2 = _level0.mc1.inTxt_2.text;
    loadv._level0.mc1.inTxt_3 = _level0.mc1.inTxt_3.text;
    loadv._level0.mc1.inTxt_4 = _level0.mc1.inTxt_4.text;
    loadv._level0.mc1.inTxt_5 = _level0.mc1.inTxt_5.text;
    loadv._level0.mc1.inTxt_6 = _level0.mc1.inTxt_6.text;
    loadv._level0.mc1.inTxt_7 = _level0.mc1.inTxt_7.text;
    loadv._level0.mc1.inTxt_8 = _level0.mc1.inTxt_8.text;
    loadv._level0.mc1.inTxt_9 = _level0.mc1.inTxt_9.text;
    loadv._level0.mc1.inTxt_10 = _level0.mc1.inTxt_10.text;
    loadv._level0.mc1.inTxt_11 = _level0.mc1.inTxt_11.text;
    loadv.send("email.php",loadv,"POST");
    (Quick question ... why is the _level0.mc1 part needed? Or is
    it even required?)
    Here's the PHP ...
    Code:
    <?php
    $To = "[email protected]";
    $subject = "site reply";
    $Name = $_POST["inTxt_1"];
    $Email = $_POST["inTxt_2"];
    $Company = $_POST["inTxt_3"];
    $Position = $_POST["inTxt_4"];
    $Address = $_POST["inTxt_5"];
    $Address1 = $_POST["inTxt_6"];
    $Address2 = $_POST["inTxt_7"];
    $ZipCode = $_POST["inTxt_8"];
    $Country = $_POST["inTxt_9"];
    $Tel = $_POST["inTxt_10"];
    $Enquiry = $_POST["enquiry"];
    $Comments = $_POST["inTxt_11"];
    \$headers = "From: " . $_POST["inTxt_1"]. "<" .
    $_POST["inTxt_2"] .">\r\n";
    $headers .= "Reply-To: " . $_POST["inTxt_2"] . "\r\n";
    $headers .= "Return-path: " . $_POST["inTxt_2"];
    $message = "Name: $Name\n";
    $message .= "Position: $Position\n";
    $message .= "Company: $Company\n";
    $message .= "Email: $Email\n";
    $message .= "Address: $Address\n";
    $message .= "Address1: $Address1\n";
    $message .= "Address2: $Address2\n";
    $message .= "Zip Code: $ZipCode\n";
    $message .= "Country: $Country\n";
    $message .= "Enquiry: $Enquiry\n";
    $message .= "Phone: $Tel\n";
    $message .= "Comments: $Comments\n";
    mail($To, $subject, $message, $headers);
    Print "Your mail has been sent";
    ?>
    (Another question - why does the one $headers line have a /
    infront of it? Should it be there?)
    Now when I submit it, "Your mail has been sent" appears on
    the screen, but I don't receive an e-mail. Can anyone help me??
    Thanks so much!!
    ~Ganj

    all those loadv._level0.mc1.whatever variables are incorrect.
    they should be:

  • Need help with Flash/PHP online form, please help, URGENT!

    ive made my online form with the scripts shown below, when i
    submit i dont get any errors... but i also dont receive any emails
    from the form, if you can see anything that ive done wrong please
    help me out..
    -------------------------------------------------------PHP
    mailer.php------------------------------------------------------------------
    <?php
    $fname = $_REQUEST["fname"];
    $mail = $_REQUEST["mail"];
    $add1 = $_REQUEST["add1"];
    $add2 = $_REQUEST["add2"];
    $add3 = $_REQUEST["add3"];
    $town = $_REQUEST["town"];
    $county = $_REQUEST["county"];
    $postcode = $_REQUEST["postcode"];
    $telephone = $_REQUEST["telephone"];
    $subject = $_REQUEST["subject"];
    $message = $_REQUEST["message"];
    $full_message = $_SERVER['REMOTE_ADDR'] . "\n\n" . $message;
    $message= $full_message;
    $fname = stripslashes($fname);
    $mail = stripslashes($mail);
    $add1 = stripslashes($add1);
    $add2 = stripslashes($add2);
    $add3 = stripslashes($add3);
    $town = stripslashes($town);
    $county = stripslashes($county);
    $postcode = stripslashes($postcode);
    $telephone = stripslashes($telephone);
    $subject = stripslashes($subject);
    $message = stripslashes($message);
    $subject = "Vision Ten Online Form ". $subject;
    if(isset($fname) and isset($mail) and isset($add1) and
    isset($add2) and isset($add3) and isset($town) and isset($county)
    and isset($postcode) and isset($telephone) and isset($subject) and
    isset($message)){
    mail("[email protected]", $fname, $mail, $add1,
    $add2, $add3, $town, $county, $postcode, $telephone, $subject,
    $message "From: $mail");
    ?>
    -------------------------------------------------------PHP-------------------------------- ----------------------------------
    -----------------------------------------------ACTIONSCRIPT
    for the
    form----------------------------------------------------------
    stop();
    System.useCodepage = true
    this.sent.onRelease = function () {
    my_vars = new LoadVars ();
    my_vars.fname = fname_box.text;
    my_vars.mail = mail_box.text;
    my_vars.add1 = add1_box.text;
    my_vars.add2 = add2_box.text;
    my_vars.add3 = add3_box.text;
    my_vars.town = town_box.text;
    my_vars.county = county_box.text;
    my_vars.postcode = postcode_box.text;
    my_vars.telephone = telephone_box.text;
    my_vars.subject = subject_box.text;
    my_vars.message = message_box.text;
    if (my_vars.fname !="" and my_vars.mail !="" and
    my_vars.add1 !="" and my_vars.town !="" and my_vars.county !="" and
    my_vars.postcode !="" and my_vars.telephone !="" and
    my_vars.subject !="" and my_vars.message !="") {
    my_vars.sendAndLoad("script/mailer.php", my_vars, "POST");
    gotoAndStop(2);
    } else {
    error_clip.gotoAndPlay(2);
    my_vars.onLoad = function (){
    gotoAndPlay(3);
    fname_box.onSetFocus = mail_box.onSetFocus =
    add1_box.onSetFocus = add2_box.onSetFocus = add3_box.onSetFocus =
    town_box.onSetFocus = county_box.onSetFocus =
    postcode_box.onSetFocus = telephone_box.onSetFocus =
    subject_box.onSetFocus = message_box.onSetFocus = function () {
    if (error_clip._currentframe !=1) {
    error_clip.gotoAndPlay(6);
    -----------------------------------------------ACTIONSCRIPT------------------------------- ---------------------------

    that php mail function looks suspect. that should be
    mail(to,subject,message,headers,parameters)

  • Need help with PHP contact form

    Hi guys,
    I've made a PHP contact form for my site and need help with a couple of things:
    The form action links an external PHP script (scripts/contact-form-script.php) but is there a way I can have it so the PHP script for the form is contained within the same PHP file as my contact form (contact.php)?
    I tried just putting the form code at the top of contact.php but the browser automatically reads the anti-spam re-direct, so maybe that needs revising too?
    The second thing is, how can I make the Name, Email and Message fields mandatory? So if a user tries to submit the form and hasn't filled in one of the required fields and clicks submit, contact.php reloads with a message at the top of the form saying something like 'Complete the required fields' and highlights the relevant field with a red border?
    Here's the code for contact.php:
    <form action="http://www.mydomain.com/scripts/contact-form-script.php" method="post" name="contact" id="contact">
    <p><strong>Name:*</strong><br />
    <input name="name" type="text" class="ctextField" /></p>
    <p><strong>E-mail:*</strong><br />
    <input name="email" type="text" class="ctextField" /></p>
    <p><strong>Telephone:</strong><br />
    <input name="telephone" type="text" class="ctextField" /></p>
    <p><strong>Company:</strong><br />
    <input name="company" type="text" class="ctextField" /></p>
    <p><strong>Address:</strong><br />
    <input name="address1" type="text" class="ctextField" /></p>
    <p><input name="address2" type="text" class="ctextField" /></p>
    <p><strong>Town:</strong><br />
    <input name="town" type="text" class="ctextField" /></p>
    <p><strong>County:</strong><br />
    <input name="county" type="text" class="ctextField" /></p>
    p><strong>Postcode:</strong><br />
    <input name="postcode" type="text" class="ctextField" /></p>
    <p><strong>Message:*</strong><br />
    <textarea name="message" cols="55" rows="8" class="ctextField"></textarea></p>
    <p><input name="submit" value="SEND MESSAGE" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
    </form>
    And this is the PHP I'm using to submit the form data for contact-form-script.php:
    <?php
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $to = "[email protected]";
    $subject = "Contact from website";
    $message = $headers;
    $message .= "Name: " . $_POST["name"] . "\r\n";
    $message .= "E-mail: " . $_POST["email"] . "\r\n";
            $message= '
                <table cellspacing="0" cellpadding="8" border="0" width="500">
                <tr>
                    <td colspan="2"></td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td width="154" style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Name</strong></td>
                  <td width="314" style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$name.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>E-mail address:</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$email.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Telephone number:</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$telephone.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Company:</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$company.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Address</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$address1.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$address2.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Town</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$town.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>County</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$county.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Postcode</strong></td>
                  <td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$postcode.'</td>
                </tr>
                <tr bgcolor="#eeeeee">
                    <td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Message</strong></td>
                </tr>              
                <tr bgcolor="#eeeeee">
                    <td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$message.'</td>
                </tr>              
                <tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
             </table>
    $url = stripslashes($_POST["url"]);
    if (!empty($url)) {
    header( 'Location: http://www.go-away-spam-robots.com' );
    exit();
    mail($to, $subject, $message, $headers);
    header( 'Location: http://www.mydomain.com/sent.php' ) ;
    ?>
    Any help on this would be greatly appreciated.
    Thank you and I hope to hear from you!
    SM

    Revised code with form validation for Name Email and Message:
    <?php
    if (array_key_exists('submit', $_POST)) {
        $name = $_POST['name'];
        $email = $_POST['email'];
        $telephone = $_POST['telephone'];
        $company = $_POST['company'];
        $address1 = $_POST['address1'];
        $address2 = $_POST['address2'];
        $town = $_POST['town'];
        $county = $_POST['county'];
        $postcode = $_POST['postcode'];
        $formMessage = $_POST['message'];
    if (empty($name)) {
                                                $warning['name'] = "Please provide your name";
    if (empty($email)) {
                                                $warning['email'] = "Please provide your email";
    if (empty($formMessage)) {
                                                $warning['message'] = "Please provide your message";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $to = "[email protected]";
    $subject = "Contact from website";
    $message = $headers;
    $message .= "Name: " . $_POST["name"] . "\r\n";
    $message .= "E-mail: " . $_POST["email"] . "\r\n";
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
            $message= "
    <table cellspacing='0' cellpadding='8' border='0' width='500'>
                <tr>
                    <td colspan='2'></td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td width='154' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Name</strong></td>
                  <td width='314' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$name."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>E-mail address:</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$email."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Telephone number:</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$telephone."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Company:</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$company."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Address</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$address1."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$address2."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Town</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$town."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>County</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$county."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Postcode</strong></td>
                  <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$postcode."</td>
                </tr>
                <tr bgcolor='#eeeeee'>
                    <td colspan='2' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Message</strong></td>
                </tr>              
                <tr bgcolor='#eeeeee'>
                    <td colspan='2' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$formMessage."</td>
                </tr>              
                <tr><td colspan='2' style='padding: 0px;'><img src='images/whitespace.gif' alt='' width='100%' height='1' /></td></tr>
             </table>
    $url = stripslashes($_POST["url"]);
    if (!empty($url)) {
    header( 'Location: http://www.go-away-spam-robots.com' );
    exit();
    if (!isset($warning)) {
    mail($to, $subject, $message, $headers);
    header( 'Location: http://www.mydomain.com/sent.php' ) ;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    p {
        margin: 0;
        padding: 10px 0 0 0;
    .warning {
        color:#C00;
    </style>
    </head>
    <body>
    <form action="" method="post" name="contact" id="contact">
    <p><strong>Name:*</strong><br />
    <input name="name" <?php if (isset($warning['name'])) { echo "style='border: 1px solid #C00'"; } ?> type="text" class="ctextField" />
    <?php if (isset($warning['name'])) { echo "<p class='warning'>".$warning['name']."</p>"; }?>
    </p>
    <p><strong>E-mail:*</strong><br />
    <input name="email" <?php if (isset($warning['email'])) { echo "style='border: 1px solid #C00'"; } ?>type="text" class="ctextField" />
    <?php if (isset($warning['name'])) { echo "<p class='warning'>".$warning['email']."</p>"; }?>
    </p>
    <p><strong>Telephone:</strong><br />
    <input name="telephone" type="text" class="ctextField" /></p>
    <p><strong>Company:</strong><br />
    <input name="company" type="text" class="ctextField" /></p>
    <p><strong>Address:</strong><br />
    <input name="address1" type="text" class="ctextField" /></p>
    <p><input name="address2" type="text" class="ctextField" /></p>
    <p><strong>Town:</strong><br />
    <input name="town" type="text" class="ctextField" /></p>
    <p><strong>County:</strong><br />
    <input name="county" type="text" class="ctextField" /></p>
    <p><strong>Postcode:</strong><br />
    <input name="postcode" type="text" class="ctextField" /></p>
    <p><strong>Message:*</strong><br />
    <?php if (isset($warning['message'])) { echo "<p class='warning'>".$warning['message']."</p>"; }?>
    <textarea name="message" <?php if (isset($warning['message'])) { echo "style='border: 1px solid #C00'"; } ?> cols="55" rows="8" class="ctextField"></textarea></p>
    <p><input name="submit" value="SEND MESSAGE" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
    </form>
    </body>
    </html>

  • Problem with 'Reply-To' on PHP contact form...

    Hi guys,
    I've created a PHP contact form which works perfectly; except, when I receive the email to my inbox and go to reply to it, it doesn't reply to the email address of the person who submitted the form - in the reply field it appears to have the default server email address.
    Here's my code which I have included in the same PHP page as my form:
    <?php
    if (array_key_exists('submit', $_POST)) {
        $name = $_POST['name'];
        $email = $_POST['email'];
        $formMessage = $_POST['message'];
    if (empty($name)) {
    $warning['name'] = "Please provide your name";
    if (empty($email)) {
    $warning['email'] = "Please provide your email address";
    if (empty($formMessage)) {
    $warning['message'] = "Please type your message";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $to = "[email protected]";
    $subject = "Enquiry from website";
    $message = $headers;
    $message .= "Name: " . $_POST["name"] . "\r\n";
    $message .= "E-mail: " . $_POST["email"] . "\r\n";
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $message= "
    <table cellspacing='0' cellpadding='8' border='0' width='500'>
    <tr>
    <td colspan='2'></td>
    </tr>
    <tr bgcolor='#eeeeee'>
    <td width='154' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Name</strong></td>
    <td width='314' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$name."</td>
    </tr>
    <tr bgcolor='#eeeeee'>
    <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>E-mail address:</strong></td>
    <td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$email."</td>
    </tr>
    <tr bgcolor='#eeeeee'>
    <td colspan='2' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Message</strong></td>
    </tr>
    <tr bgcolor='#eeeeee'>
    <td colspan='2' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$formMessage."</td>
    </tr>
    <tr><td colspan='2' style='padding: 0px;'></td></tr>
    </table>
    $url = stripslashes($_POST["url"]);
    if (!empty($url)) {
    header( 'Location: http://www.go-away-spam-robots.com' );
    exit();
    if (!isset($warning)) {
    mail($to, $subject, $message, $headers);
    header( 'Location: http://www.mydomain.com/thankyou.php' ) ;
    ?>
    Can anyone see from my code why this would be happening?
    Thank you very much and hope to hear from you!
    SM

    Sorted!
    I removed...
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    ...and added...
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";

  • PHP Contact Form Problem

    Hi all,
    I'm trying to use a php Contact form and it's throwing up an error even before I click submit. As a newbie to PHP I don't really know where I am going wrong.
    Here's the link to the contact form.
    http://www.thesketchcollective.co.uk/clients/form-example/myform1.php
    Secondly, I would also like the form to send an email as well as send the info to CSV format. It currently just sends it to a CSV.
    Any help would be appreciated.
    Cheers
    Tom

    <?php
    if($_POST['formSubmit'] == "Submit")
    $errorMessage = "";
    if(empty($_POST['formMovie']))
    $errorMessage .= "<li>You forgot to enter a movie!</li>";
    if(empty($_POST['formName']))
    $errorMessage .= "<li>You forgot to enter a name!</li>";
    $varMovie = $_POST['formMovie'];
    $varName = $_POST['formName'];
    if(empty($errorMessage))
    $fs = fopen("mydata.csv","a");
    fwrite($fs,$varName . ", " . $varMovie . "\n");
    fclose($fs);
    header("Location: thankyou.html");
    exit;
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>My Form</title>
    </head>
    <body>
    <?php
    if(!empty($errorMessage))
    echo("<p>There was an error with your form:</p>\n");
    echo("<ul>" . $errorMessage . "</ul>\n");
    ?>
    <form action="myform1.php" method="post">
    <p>
    What is your favorite movie?<br>
    <input type="text" name="formMovie" maxlength="50" value="<?=$varMovie;?>" />
    </p>
    <p>
    What is your name?<br>
    <input type="text" name="formName" maxlength="50" value="<?=$varName;?>" />
    </p>
    <input type="submit" name="formSubmit" value="Submit" />
    </form>
    </body>
    </html>

  • PHP contact form problems

    I've tried editing my contact form in a way that I could edit it. But, recently I've tried replacing the color behind my submit button. Instead the images I placed behind the text boxes end up being placed behind the submit button. If you could help me figure this out, that would be great Also if you have the chance, could you tell me how to get rid of the message area boxes' color and change it to transparent... and help me place an image behind it to replace the color. Thanks
    <?php
    //If the form is submitted
    if(isset($_POST['submit'])) {
    //Check to make sure that the name field is not empty
    if(trim($_POST['contactname']) == '') {
    $hasError = true;
    } else {
    $name = trim($_POST['contactname']);
    //Check to make sure that the subject field is not empty
    if(trim($_POST['subject']) == '') {
    $hasError = true;
    } else {
    $subject = trim($_POST['subject']);
    //Check to make sure sure that a valid email address is submitted
    if(trim($_POST['email']) == '') {
    $hasError = true;
    } else if (!eregi("^[A-Z0-9.%-]@[A-Z0-9.%-].[A-Z]{2,4}$", trim($_POST['email']))) {
    $hasError = true;
    } else {
    $email = trim($_POST['email']);
    //Check to make sure comments were entered
    if(trim($_POST['message']) == '') {
    $hasError = true;
    } else {
    if(function_exists('stripslashes')) {
    $comments = stripslashes(trim($_POST['message']));
    } else {
    $comments = trim($_POST['message']);
    //If there is no error, send the email
    if(!isset($hasError)) {
    $emailTo = '[email protected]'; //Put your own email address here
    $body = "Name: $name
    Email: $email
    Subject: $subject
    Comments:
    $comments";
    $headers = 'From: Barca Graphics Contact form <'.$emailTo.'>' . "
    " . 'Reply-To: ' . $email;
    mail($emailTo, $subject, $body, $headers);
    $emailSent = true;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>PHP Contact Form with JQuery Validation</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
    <script src="jquery.validate.pack.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready(function(){
    $("#contactform").validate();
    </script>
    <style type="text/css">
    body {
    font-family:Arial, Tahoma, sans-serif ;
    #contact-wrapper {
    width:429px;
    border:;
    background:transparent ;
    padding:;
    #contact-wrapper div {
    clear:both;
    margin:1em 0;
    #contact-wrapper label {
    display:block;
    float:none;
    font-size:16px;
    width:auto;
    form#contactform input {
    background-color:transparent;;
    background-image:url('http://submitpage.webege.com/images/shapeimage_2.png');
    border-width:0px;
    padding:6px;
    padding-bottom:10px;
    font-size:16px;
    color:none;
    form#contactform textarea {
    font-family:Arial, Tahoma, Helvetica, sans-serif;
    font-size:100%;
    padding:0.6em 0.5em 0.7em;
    border-color:transparent;;
    border-style:transparent;
    border-width:1px;
    </style>
    </head>
    <body>
    <form method="post" action="<?php echo $SERVER['PHPSELF']; ?>" id="contactform">
    <label for="name"></label>
    <input type="text" size="50" name="contactname" id="contactname" value="Name" class="required"/>
    <label for="email"></label>
    <input type="text" size="50" name="email" id="email" value="Email" />
    <label for="subject"></label>
    <input type="text" size="50" name="subject" id="subject" value="Subject" />
    <label for="message"></label>
    <textarea rows="5" cols="50" name="message" id="message" class="required"></textarea>
    <input type="submit" value="Send" name="submit" />
    </form>
    <?php if(isset($hasError)) { //If errors are found ?>
    Please check if you've filled all the fields with valid information. Thank you.
    <?php } ?>
    <?php if(isset($emailSent) && $emailSent == true) { //If email is sent ?>
    Email Successfully Sent!
    Thank you <?php echo $name;?> for contacting Barca Graphics.
    <?php } ?>
    </body>
    </html>

    ereg() has been deprecated, it is recommended that you dont use it.
    You want to look at this
    http://www.php.net/manual/en/function.preg-match.php
    Within this page I found this:
    If you need to check for .com.br and .com.au and .uk and all the other crazy domain endings i found the following expression works well if you want to validate an email address. Its quite generous in what it will allow
    <?php
            $email_address = "phil.taylor@a_domain.tv";
         if (preg_match("/^[^@]*@[^@]*\.[^@]*$/", $email_address)) {
             return "E-mail address";        
    ?>

  • Grr. Cannot get PHP contact form to work.

    Hi!
    I cannot get a PHP contact form working. I have tried
    everything i can think of (which isn't much!) and can't get it to
    work. This is what i am using. Can anybody see what's wrong with
    this please? As you can see, the form contains a fromname,
    fromemail, subject and message fields.
    I'm a complete newb when it comes to PHP. Please please
    please help.

    Thanks for your reply.
    I just used the PHP provided in
    this
    tutorial?! Is the tutorial wrong?
    Sorry. As i said, i know nothing about PHP. How do i define
    the variables.

  • HTML 5 Contact Form "Placeholder" instead of label makes form validation not work

    Hi,
    I am trying to implement a HTML 5 contact form which uses a "placeholder" within the field instead of a label. But now the form validation does not work.
    The site is at http://www.partnerrealestate.ch/avenuedefrance23/index.html and it is not using any workflows from BC as the person receiving it is an external person and the process does not require a workflow.
    Would appreciate any input into this.
    Kindest Regards,
    corina

    There is no label on input fields. The form does not work because you have edited the names. BC needs the ID and names to be as it is issue when you create the form so it knows what to use for the validation and what information to pass into the database.
    So where you have edited these, you need to restore those.
    You have some invalid html on some input's as well one has input="" inside of it when rendered so that is not right.
    It is not to do with placeholder use. So fix up your HTML errors, correct the name and ID changes and it will work fine.

  • Can Anyone help with syncing my contacts are getting duplicated and there is a file from my computer and they are not the same it is driving me carazy can anyone help?

    Can Anyone help with syncing my contacts are getting duplicated and there is a file from my computer and they are not the same it is driving me carazy can anyone help?

    Are you in DSL? Do you know if your modem is bridged?
    "Sometimes your knight in shining armor is just a retard in tin foil.."-ARCHANGEL_06

  • I need help with a 1 Page Form with scrollable text field (5000 limit characters) and printing

    Hello, I have no training in using Adobe Acrobat Pro or Livecycle Designer so I need major help with a 1 page form that I am attempting to create. Basically the form will be used to nominate employees for a Job Well Done Award.
    The form contains the following:
    1.) The name(s) of the employees being nominated and the date of the accomplishment.
    2.) In the middle of the page I have a section for a write up, limited to 5000 characters, this is were I am needing the most help. A couple of things, about this section: The font is set at 11 and I don't want it to change. The text field has multiple-line, scroll long text enabled. The text field is a certain size and can only hold so much text, then it starts to scroll, which I am ok with, I like that feature. The issue I am having is during printing. I would like to keep the text field scrollable but when I print I would like to be able to print everything in that field. Executing this is the problem, I have no clue how to do it. I was hoping for some setting within Acrobat Pro or LiveCycle to be available, but the more I read and research this, it appears that it may require java, xml, basically some coding. I don't know for sure.
    3.) Below the text field I have another field for the person nominating to type their name and right next to that another field for a digital signature.
    4.) And finally below those two fields I have a Submit button that is setup to start email application so the form can be emailed to the proper inbox.
    Thank you in advance.

    With an Acrobat form the only thing you can do is export the text to
    another location (like a blank field on another page) or to another file
    format. With an LCD form you can expand the text box itself, but you'll
    need to ask about that over at the LCD Scripting forum.

  • Help with JS form, PHP Contact Form....

    I originally posted this in another area, but had no luck...
    I'm having trouble with a template that I downloaded (from Template Monster). My contact form shows "submitted", but I get no email.  I will submit my coding below & see if someone can help... My JS.forms is in a "JS" sub-folder in the main directory and my index.html and MailHandler.php/ashx files are in the main directory.
    MailHandler.php --
    <?php
        $owner_email = $_POST["owner_email"];
        $headers = 'From:' . $_POST["email"];
        $subject = 'A message from your site visitor ' . $_POST["name"];
        $messageBody = "";
        if($_POST['name']!='nope'){
            $messageBody .= '<p>Visitor: ' . $_POST["name"] . '</p>' . "\n";
            $messageBody .= '<br>' . "\n";
        if($_POST['email']!='nope'){
            $messageBody .= '<p>Email Address: ' . $_POST['email'] . '</p>' . "\n";
            $messageBody .= '<br>' . "\n";
        }else{
            $headers = '';
        if($_POST['state']!='nope'){       
            $messageBody .= '<p>State: ' . $_POST['state'] . '</p>' . "\n";
            $messageBody .= '<br>' . "\n";
        if($_POST['phone']!='nope'){       
            $messageBody .= '<p>Phone Number: ' . $_POST['phone'] . '</p>' . "\n";
            $messageBody .= '<br>' . "\n";
        if($_POST['fax']!='nope'){       
            $messageBody .= '<p>Fax Number: ' . $_POST['fax'] . '</p>' . "\n";
            $messageBody .= '<br>' . "\n";
        if($_POST['message']!='nope'){
            $messageBody .= '<p>Message: ' . $_POST['message'] . '</p>' . "\n";
        if($_POST["stripHTML"] == 'true'){
            $messageBody = strip_tags($messageBody);
        try{
            if(!mail($owner_email, $subject, $messageBody, $headers)){
                throw new Exception('mail failed');
            }else{
                echo 'mail sent';
        }catch(Exception $e){
            echo $e->getMessage() ."\n";
    ?>
    JS Form --
    //forms
    ;(function($){
        $.fn.forms=function(o){
            return this.each(function(){
                var th=$(this)
                    ,_=th.data('forms')||{
                        errorCl:'error',
                        emptyCl:'empty',
                        invalidCl:'invalid',
                        notRequiredCl:'notRequired',
                        successCl:'success',
                        successShow:'4000',
                        mailHandlerURL:'MailHandler.php',
                        ownerEmail:'I have Client's Email Here',
                        stripHTML:true,
                        smtpMailServer:'localhost',
                        targets:'input,textarea',
                        controls:'a[data-type=reset],a[data-type=submit]',
                        validate:true,
                        rx:{
                            ".name":{rx:/^[a-zA-Z'][a-zA-Z-' ]+[a-zA-Z']?$/,target:'input'},
                            ".state":{rx:/^[a-zA-Z'][a-zA-Z-' ]+[a-zA-Z']?$/,target:'input'},
                            ".email":{rx:/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@(( ?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1 [0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][ 0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i,target:'input'},
                            ".phone":{rx:/^\+?(\d[\d\-\+\(\) ]{5,}\d$)/,target:'input'},
                            ".fax":{rx:/^\+?(\d[\d\-\+\(\) ]{5,}\d$)/,target:'input'},
                            ".message":{rx:/.{20}/,target:'textarea'}
                        preFu:function(){
                            _.labels.each(function(){
                                var label=$(this),
                                    inp=$(_.targets,this),
                                    defVal=inp.val(),
                                    trueVal=(function(){
                                                var tmp=inp.is('input')?(tmp=label.html().match(/value=['"](.+?)['"].+/),!!tmp&&!!tmp[1]&&tmp [1]):inp.html()
                                                return defVal==''?defVal:tmp
                                trueVal!=defVal
                                    &&inp.val(defVal=trueVal||defVal)
                                label.data({defVal:defVal})                               
                                inp
                                    .bind('focus',function(){
                                        inp.val()==defVal
                                            &&(inp.val(''),_.hideEmptyFu(label),label.removeClass(_.invalidCl))
                                    .bind('blur',function(){
                                        _.validateFu(label)
                                        if(_.isEmpty(label))
                                            inp.val(defVal)
                                            ,_.hideErrorFu(label.removeClass(_.invalidCl))                                           
                                    .bind('keyup',function(){
                                        label.hasClass(_.invalidCl)
                                            &&_.validateFu(label)
                                label.find('.'+_.errorCl+',.'+_.emptyCl).css({display:'block'}).hide()
                            _.success=$('.'+_.successCl,_.form).hide()
                        isRequired:function(el){                           
                            return !el.hasClass(_.notRequiredCl)
                        isValid:function(el){                           
                            var ret=true
                            $.each(_.rx,function(k,d){
                                if(el.is(k))
                                    ret=d.rx.test(el.find(d.target).val())                                       
                            return ret                           
                        isEmpty:function(el){
                            var tmp
                            return (tmp=el.find(_.targets).val())==''||tmp==el.data('defVal')
                        validateFu:function(el){                           
                            el.each(function(){
                                var th=$(this)
                                    ,req=_.isRequired(th)
                                    ,empty=_.isEmpty(th)
                                    ,valid=_.isValid(th)                               
                                if(empty&&req)
                                    _.showEmptyFu(th.addClass(_.invalidCl))
                                else
                                    _.hideEmptyFu(th.removeClass(_.invalidCl))
                                if(!empty)
                                    if(valid)
                                        _.hideErrorFu(th.removeClass(_.invalidCl))
                                    else
                                        _.showErrorFu(th.addClass(_.invalidCl))                               
                        getValFromLabel:function(label){
                            var val=$('input,textarea',label).val()
                                ,defVal=label.data('defVal')                               
                            return label.length?val==defVal?'nope':val:'nope'
                        ,submitFu:function(){
                            _.validateFu(_.labels)                           
                            if(!_.form.has('.'+_.invalidCl).length)
                                $.ajax({
                                    type: "POST",
                                    url:_.mailHandlerURL,
                                    data:{
                                        name:_.getValFromLabel($('.name',_.form)),
                                        email:_.getValFromLabel($('.email',_.form)),
                                        phone:_.getValFromLabel($('.phone',_.form)),
                                        fax:_.getValFromLabel($('.fax',_.form)),
                                        state:_.getValFromLabel($('.state',_.form)),
                                        message:_.getValFromLabel($('.message',_.form)),
                                        owner_email:_.ownerEmail,
                                        stripHTML:_.stripHTML
                                    success: function(){
                                        _.showFu()
                        showFu:function(){
                            _.success.slideDown(function(){
                                setTimeout(function(){
                                    _.success.slideUp()
                                    _.form.trigger('reset')
                                },_.successShow)
                        controlsFu:function(){
                            $(_.controls,_.form).each(function(){
                                var th=$(this)
                                th
                                    .bind('click',function(){
                                        _.form.trigger(th.data('type'))
                                        return false
                        showErrorFu:function(label){
                            label.find('.'+_.errorCl).slideDown()
                        hideErrorFu:function(label){
                            label.find('.'+_.errorCl).slideUp()
                        showEmptyFu:function(label){
                            label.find('.'+_.emptyCl).slideDown()
                            _.hideErrorFu(label)
                        hideEmptyFu:function(label){
                            label.find('.'+_.emptyCl).slideUp()
                        init:function(){
                            _.form=_.me                       
                            _.labels=$('label',_.form)
                            _.preFu()
                            _.controlsFu()
                            _.form
                                .bind('submit',function(){
                                    if(_.validate)
                                        _.submitFu()
                                    else
                                        _.form[0].submit()
                                    return false
                                .bind('reset',function(){
                                    _.labels.removeClass(_.invalidCl)                                   
                                    _.labels.each(function(){
                                        var th=$(this)
                                        _.hideErrorFu(th)
                                        _.hideEmptyFu(th)
                            _.form.trigger('reset')
                _.me||_.init(_.me=th.data({forms:_}))
                typeof o=='object'
                    &&$.extend(_,o)
    })(jQuery)
    $(window).load(function() {   
        $('#ContactForm').forms({
            ownerEmail:'I Have Client's Email Here'
    Contact HTML --
    <form action="contact.php" method="post" id="ContactForm">
                                <div class="success"> Contact form submitted!<br>
                                  <strong>We will be in touch soon.</strong> </div>
                                <fieldset>
                                  <div class="wrapper">
                                    <span class="col1">Name:</span>
                                    <label class="name">
                                      <span class="bg"><input name="cf_name" type="text" class="input"></span>
                                      <span class="error">*This is not a valid name.</span> <span class="empty">*This field is required.</span>
                                      </label>
                                    </div>
                                  <div class="wrapper">
                                    <span class="col1">Email:</span>
                                    <label class="email">
                                      <span class="bg"><input name="cf_email" type="text" class="input"></span>
                                      <span class="error">*This is not a valid email address.</span> <span class="empty">*This field is required.</span>
                                      </label>
                                    </div>
                                  <div class="wrapper">
                                    <span class="col1">Phone:</span>
                                    <label class="phone">
                                      <span class="bg"><input name="cf_phone" type="text" class="input"></span>
                                      <span class="error">*This is not a valid phone number.</span> <span class="empty">*This field is required.</span>
                                      </label>
                                    </div>
                                  <div class="wrapper">
                                    <span class="col1">Message:</span>
                                    <label class="message">
                                      <span class="bg"><textarea name="cf_message" rows="1" cols="1"></textarea></span>
                                      <span class="error">*The message is too short.</span> <span class="empty">*This field is required.</span>
                                      </label>
                                    </div>
                                  <div class="btns"><a href="#" class="link1" data-type="submit">Send</a><a href="#" class="link1" data-type="reset">Clear</a></div>
                                  </fieldset>
                                </form>

    If Template Monster supplied you with this code, I think you should contact them about it.
    It's not how I would do things.
    Nancy O.

Maybe you are looking for

  • Error trying to create https connection from Web Dynpro

    Hi experts!! I am trying to create a WD view with an actionButton and a form template, when the user fills the data in the form and presses the button, i want to create an Https connect and post some parameters to the URL. HttpsURLConnection cannot b

  • Error message while doing MIGO.

    Hi, I am getting error message while doing MIGO. Can some one help me out in this issue. Consolidated companies 0 and 5686 are different Message no. F5 080 Diagnosis The number of the affiliated company must be clear for the selected document type fo

  • SAP JVM update to latest version in NW 7.31 Java only stack

    Hi ALL, Can I know what is the procedure involved updating JVM? As there is no JSPM in 7.31 what are the options to update? I tried by extracting SAR file and changing version in parameter file but it wasn't successful. After changing to latest versi

  • Skype/Samsung TV Camera - audio and chipmunk/heliu...

    As has been posted elsewhere although not that i can find for this specific product, the Samsung TV (Skype certified) camera/mic combo CY-STC1100 has me sounding like a member of Alvin and the Chipmunks.  I've used Skype with my computer without an i

  • Ideal Solution

    I cannot wait for this program to release.  Like so many people interested in this project, I come from a print design background and dread coding.  It's not so much that I avoid coding, as I realize it is not the best use of my time.  In the time it