Skip to main content
Known Participant
December 30, 2013
Answered

Why won't this contact form work?

  • December 30, 2013
  • 1 reply
  • 26681 views

Hi All,

Ok so i decided to update the contact form of page below as i was using the out dated spry validation method. I inserted the new contact form using webassist dreamweaver extension but i am now having big problems with this page. I am now unable to even open the page, please use link below to see the page error and i have also pasted the code of this page.

http://www.milesfunerals.com/contact.php

<?php virtual("/webassist/form_validations/wavt_scripts_php.php"); ?>

<?php virtual("/webassist/form_validations/wavt_validatedform_php.php"); ?>

<!DOCTYPE HTML>

<html>

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Miles & Daughters | Contact us by email or phone</title>

<meta name="description" content="Contact us and speak to any of our friendly staff if you have any enquiries or if you would prefer you can contact us by email. You can also see pictures of all five of our branches. ">

<meta name="keywords" content="contact, questions, enquiries, friendly, email, addresses, write, funeral home, branches, reading, wokingham, crowthorne, twyford, bracknell">

<!--[if lt IE 9]>

<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>

<![endif]-->

<link href="/stylesheet.css" rel="stylesheet" type="text/css" />

<link rel="stylesheet" href="fancyBox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />

<script src="http://code.jquery.com/jquery-latest.min.js"></script>

<script type="text/javascript" src="fancyBox/source/jquery.fancybox.pack.js?v=2.1.5"></script>

<script type="text/javascript">

$(document).ready(function() {

$('.fancybox').fancybox();

});

</script>

<style type="text/css">

#sprytextfield2{

           form input[type=text] {width: 75%}

textarea {width: 85%}

#sprytextfield1{

           form input[type=text] {width: 75%}

textarea {width: 85%}

</style>

<LINK REL="SHORTCUT ICON" HREF="http://www.milesmemorials.com/favicon.ico">

<script src="/webassist/progress_bar/jquery-blockui-formprocessing.js" type="text/javascript"></script>

<link href="/SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">

<script src="/SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>

<script src="/webassist/forms/wa_servervalidation.js" type="text/javascript"></script>

<link href="/webassist/forms/fd_basic_default.css" rel="stylesheet" type="text/css">

</head>

<body>

<div id="container">

<?php include('includes/header.php'); ?>

<?php include('includes/navbar2.php'); ?>

<?php include('includes/navbar.php'); ?>

<?php include('includes/sidebar.php'); ?>

<div id="maindiv" class="maindiv_scroll">

  <p> </p>

  <p> </p>

    <p class="subheading">Miles and Daughters - Contact us</p>

  <p class="sub2">Addresses and telephone numbers for our offices are:</p>

<p class="maintext"> </p>

<p class="wokingham"><span class="address"><a class="fancybox" href="images/Isabella house.jpg" title="Miles & Daughters Winnersh Premises"><img src="images/Isabella house.jpg" alt="Miles & Daughters Wokingham premisesh" width="297" height="263" class="shop"/></a></span> </p>

<p class="wokingham"> </p>

<p class="wokingham">Wokingham</p>

<p class="address">Isabella House  </p>

<p class="address">498a Reading Road</p>

  <p class="address"> Winnersh </p>

  <p class="address">Berkshire</p>

  <p class="address"> RG41 5EX</p>

  <p class="address"> Telephone: 0118 979 3004</p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="address"><a class="fancybox" href="images/cav-1.jpg" title="Miles & Daughters Reading Premises"><img src="/images/cav-1.jpg" alt="Miles & Daughters Reading premises" width="380" height="321" class="shop"/></a></p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="wokingham">Reading</p>

<p class="address">Tamela House</p>

  <p class="address">157-161 Caversham Road</p>

  <p class="address">Reading</p>

  <p class="address">Berkshire</p>

  <p class="address">RG1 8BB</p>

  <p class="address">Telephone: 0118 959 0022</p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="address"><a class="fancybox" href="images/Ivydene2.jpg" title="Miles & Daughters Binfield Premises"><img src="images/Ivydene2.jpg" alt="Miles & Daughters Bracknell premises" width="380" height="267" class="shop"/></a></p>

  <p class="wokingham"> </p>

  <p class="wokingham"> </p>

  <p class="wokingham"> </p>

  <p class="wokingham"> </p>

  <p class="wokingham">Bracknell</p>

  <p class="address">Ivydene House</p>

  <p class="address">Forest Road</p>

  <p class="address">Binfield</p>

  <p class="address">Bracknell</p>

  <p class="address">RG42 4HP</p>

  <p class="address">Telephone: 01344 452020  </p>

  <p class="wokingham"><span class="address"><a class="fancybox" href="images/twford.jpg" title="Miles & Daughters Twyford Premises"><img src="images/twford.jpg" alt="Miles & Daughters Twyford premises" width="263" height="317" class="shop"/></a></span></p>

  <p class="wokingham"> </p>

  <p class="wokingham"> </p>

  <p class="wokingham"> </p>

  <p class="wokingham"> </p>

  <p class="wokingham"> </p>

  <p class="wokingham"> </p>

  <p class="wokingham">Twyford</p>

<p class="address">The Old Clock House</p>

  <p class="address">Station Road</p>

  <p class="address"> Twyford</p>

  <p class="address">Berkshire </p>

  <p class="address">RG10 9NS</p>

  <p class="address"> Telephone: 0118 934 5474</p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="address"><a class="fancybox" href="images/crowthorne.jpg" title="Miles & Daughters Crowthorne Premises"><img src="images/crowthorne.jpg" alt="Miles & Daughters Crowthorne premises" width="362" height="239" class="shop"/></a></p>

  <p class="wokingham"> </p>

  <p class="wokingham"> </p>

    <p class="wokingham">Crowthorne</p>

<p class="address">Alicya House</p>

  <p class="address">105 High Street</p>

  <p class="address"> Crowthorne</p>

  <p class="address">Berkshire </p>

  <p class="address">RG45 7AD</p>

  <p class="address"> Telephone: 01344 774932</p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="address"> </p>

  <p class="endtext"> </p>

  <p class="endtext"> </p>

  <p class="maintext">You may email us or alternatively use the form below to contact us, one of our members of staff will respond as soon as possible.  </p>

  <p> </p>

  <div id="SimpleContact_Basic_Default_ProgressWrapper">

    <form class="Basic_Default" id="SimpleContact_Basic_Default" name="SimpleContact_Basic_Default" method="post" action="form-to-email.php">

      <!--

WebAssist CSS Form Builder - Form v1

CC: Contact

CP: Simple Contact

TC: Basic

TP: Default

-->

      <ul class="Basic_Default">

        <li>

          <fieldset class="Basic_Default" id="Contact_me">

            <legend class="groupHeader">Contact</legend>

            <ul class="formList">

              <li class="formItem"> <span class="fieldsetDescription"> Required * </span> </li>

              <li class="formItem">

                <div class="formGroup">

                  <div class="lineGroup">

                    <div class="fullColumnGroup">

                      <label for="Full_Name" class="sublabel" > Name:<span class="requiredIndicator"> *</span></label>

                      <div class="errorGroup">

                        <div class="fieldPair">

                          <div class="fieldGroup"> <span id="Full_Name_Spry"> <span>

                            <input id="Full_Name" name="Full_Name" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("formtoemail","Full_Name"):"")); ?>" class="formTextfield_Large" tabindex="1" onBlur="hideServerError('Full_Name_ServerError');">

                            <span class="textfieldRequiredMsg">Please enter your name</span> </span> </span>

                            <?php

if (ValidatedField('formtoemail','formtoemail'))  {

  if ((strpos((",".ValidatedField("formtoemail","formtoemail").","), "," . "1" . ",") !== false || "1" == ""))  {

    if (!(false))  {

?>

                              <span class="serverInvalidState" id="Full_Name_ServerError">Please enter your name</span>

                              <?php //WAFV_Conditional form-to-email.php formtoemail(1:)

    }

  }

}?>

                          </div>

                        </div>

                      </div>

                    </div>

                  </div>

                  <div class="lineGroup">

                    <div class="fullColumnGroup">

                      <label for="Email_Address" class="sublabel" > Email:<span class="requiredIndicator"> *</span></label>

                      <div class="errorGroup">

                        <div class="fieldPair">

                          <div class="fieldGroup"> <span id="Email_Address_Spry"> <span>

                            <input id="Email_Address" name="Email_Address" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("formtoemail","Email_Address"):"")); ?>" class="formTextfield_Large" tabindex="2" onBlur="hideServerError('Email_Address_ServerError');">

                            <span class="textfieldInvalidFormatMsg">Invalid format.</span><span class="textfieldRequiredMsg">Please enter a full email address</span> </span> </span>

                            <?php

if (ValidatedField('formtoemail','formtoemail'))  {

  if ((strpos((",".ValidatedField("formtoemail","formtoemail").","), "," . "2" . ",") !== false || "2" == ""))  {

    if (!(false))  {

?>

                              <span class="serverInvalidState" id="Email_Address_ServerError">Please enter a full email address</span>

                              <?php //WAFV_Conditional form-to-email.php formtoemail(2:)

    }

  }

}?>

                          </div>

                        </div>

                      </div>

                    </div>

                  </div>

                  <div class="lineGroup">

                    <div class="fullColumnGroup">

                      <label for="Comments" class="sublabel" > Comments:</label>

                      <div class="errorGroup">

                        <div class="fieldPair">

                          <div class="fieldGroup"> <span>

                            <textarea name="Comments" id="Comments" class="formTextarea_Medium" rows="1" cols="1" tabindex="3"><?php echo((isset($_GET["invalid"])?ValidatedField("formtoemail","Comments"):"")); ?></textarea>

                          </span> </div>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

              </li>

              <li class="formItem">

                <div class="formGroup">

                  <div class="lineGroup">

                    <div class="fullColumnGroup">

                      <div class="fullColumnGroup">

                        <label for="Security_Code" class="sublabel" > </label>

                        <div class="errorGroup">

                          <div class="fieldPair">

                            <div class="fieldGroup"> <span> <img src="/webassist/captcha/wavt_captchasecurityimages.php?field=Security_Code&noisefreq=15&noisecolor=060606&gridcolor=080808&font=fonts/MOM_T___.TTF&textcolor=040404" alt="Security Code" class="Captcha"> </span> </div>

                          </div>

                        </div>

                      </div>

                      <div class="fullColumnGroup" style="clear:left;">

                        <label for="Security_Code" class="sublabel" > Security code:<span class="requiredIndicator"> *</span></label>

                        <div class="errorGroup">

                          <div class="fieldPair">

                            <div class="fieldGroup"> <span id="Security_Code_Spry"> <span>

                              <input id="Security_Code" name="Security_Code" type="text" value="" class="formTextfield_Large" tabindex="4" onBlur="hideServerError('Security_Code_ServerError');">

                              <span class="textfieldRequiredMsg">Entered text does not match; please try again</span> </span> </span>

                              <?php

if (ValidatedField('formtoemail','formtoemail'))  {

  if ((strpos((",".ValidatedField("formtoemail","formtoemail").","), "," . "3" . ",") !== false || "3" == ""))  {

    if (!(false))  {

?>

                                <span class="serverInvalidState" id="Security_Code_ServerError">Entered text does not match; please try again</span>

                                <?php //WAFV_Conditional form-to-email.php formtoemail(3:)

    }

  }

}?>

                            </div>

                          </div>

                        </div>

                      </div>

                    </div>

                  </div>

                  <div class="lineGroup">

                    <div class="fullColumnGroup">

                      <div class="fullColumnGroup">

                        <label for="Security_Answer_2" class="sublabel" > </label>

                        <div class="errorGroup">

                          <div class="fieldPair">

                            <div class="fieldGroup"> <span> <span class="precedingText">

                              <?php virtual("/webassist/captcha/wavt_captchasecurityquestion.php"); ?>

                            </span> </span> </div>

                          </div>

                        </div>

                      </div>

                      <div class="fullColumnGroup" style="clear:left;">

                        <label for="Security_Answer" class="sublabel" > Answer:<span class="requiredIndicator"> *</span></label>

                        <div class="errorGroup">

                          <div class="fieldPair">

                            <div class="fieldGroup"> <span id="Security_Answer_Spry"> <span>

                              <input id="Security_Answer" name="Security_Answer" type="text" value="" class="formTextfield_Large" tabindex="5" onBlur="hideServerError('Security_Answer_ServerError');">

                              <span class="textfieldRequiredMsg">Incorrect

                                response; please try again</span> </span> </span>

                              <?php

if (ValidatedField('formtoemail','formtoemail'))  {

  if ((strpos((",".ValidatedField("formtoemail","formtoemail").","), "," . "4" . ",") !== false || "4" == ""))  {

    if (!(false))  {

?>

                                <span class="serverInvalidState" id="Security_Answer_ServerError">Incorrect

                                  response; please try again</span>

                                <?php //WAFV_Conditional form-to-email.php formtoemail(4:)

    }

  }

}?>

                            </div>

                          </div>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

              </li>

              <li class="formItem"> <span class="buttonFieldGroup" >

                <input id="Hidden_Field" name="Hidden_Field" type="hidden" value="<?php echo((isset($_GET["invalid"])?ValidatedField("formtoemail","Hidden_Field"):"")); ?>">

                <input class="formButton" name="SimpleContact_submit" type="submit" id="SimpleContact_submit" value="Contact me"  onClick="clearAllServerErrors('SimpleContact_Basic_Default')">

              </span> </li>

            </ul>

          </fieldset>

        </li>

      </ul>

    </form>

  </div>

  <div id="SimpleContact_Basic_Default_ProgressMessageWrapper" class="blockUIOverlay" style="display:none;">

    <script type="text/javascript">

WADFP_SetProgressToForm('SimpleContact_Basic_Default', 'SimpleContact_Basic_Default_ProgressMessageWrapper', WADFP_Theme_Options['BigSpin:Slate']);

    </script>

    <div id="SimpleContact_Basic_Default_ProgressMessage" >

      <p style="margin:10px; padding:5px;" ><img src="/webassist/progress_bar/images/slate-largespin.gif" alt="" title="" style="vertical-align:middle;" />  Please wait</p>

    </div>

  </div>

  <p class="maintext"> </p>

</div>

<?php include('includes/footer.php'); ?>

</div>

<script type="text/javascript">

var Full_Name_Spry = new Spry.Widget.ValidationTextField("Full_Name_Spry", "none",{validateOn:["blur"]});

var Email_Address_Spry = new Spry.Widget.ValidationTextField("Email_Address_Spry", "email",{validateOn:["blur"]});

var Security_Code_Spry = new Spry.Widget.ValidationTextField("Security_Code_Spry", "none",{validateOn:["blur"]});

var Security_Answer_Spry = new Spry.Widget.ValidationTextField("Security_Answer_Spry", "none",{validateOn:["blur"]});</script>

</body>

</html>

    This topic has been closed for replies.
    Correct answer osgood_

    No it doesnt this is what i have for it on the php page -

      $WAFV_Errors .= WAValidateRX((isset($_POST["Hidden_Field"])?$_POST["Hidden_Field"]:"") . "","/.* /",false,5);

      if ($WAFV_Errors != "")  {

        PostResult($WAFV_Redirect,$WAFV_Errors,"formtoemail");

      }

    }


    Ness_quick wrote:

    No it doesnt this is what i have for it on the php page -

      $WAFV_Errors .= WAValidateRX((isset($_POST["Hidden_Field"])?$_POST["Hidden_Field"]:"" ) . "","/.* /",false,5);

      if ($WAFV_Errors != "")  {

        PostResult($WAFV_Redirect,$WAFV_Errors,"formtoemail");

      }

    }

    Not sure what that does to be honest.

    Seems to me all you really need is to make sure the form is not submitted by a spam bot.

    The form seems to work up until the point of the spam security validation.

    You could try adding an additional hidden form field after the current hidden form field:

    <input type="hidden" name="antiSpam">

    Then insert the below at the beginning of your form-to-email.php file after the opening <?php tag. If a spam bot populates the field then the 'exit;' php command should terminate the php file processing any further and the information never gets sent to the recipients email address - job done.

    // check antiSpam form field

    $antiSpam = trim($_POST['antiSpam']);

    if (!empty($antiSpam)) {

        exit;

    }

    As said in my last post you can test by temporary making the hidden field a normal <input type="text" form field.

    If this works then you can get rid of the captcha

    1 reply

    David_Powers
    Inspiring
    December 30, 2013

    I suspect the problem is caused by these two lines:

    <?php virtual("/webassist/form_validations/wavt_scripts_php.php"); ?>

    <?php virtual("/webassist/form_validations/wavt_validatedform_php.php"); ?>

    They use the PHP virtual() function to include external files using a site-root relative link. The virtual() function works only on Apache, and it's extremely flaky. Use require() with a document-relative link instead.

    Assuming that the webassist folder is at the top level of your site, this should do it:

    <?php require("webassist/form_validations/wavt_scripts_php.php"); ?>

    <?php require("webassist/form_validations/wavt_validatedform_php.php"); ?>

    Known Participant
    December 30, 2013

    Ok, that has now allowed page to open but there is now another error on line 250? Also the footer doesn't seem to appear?

    Known Participant
    December 31, 2013

    Ness_quick wrote:

    No it doesnt this is what i have for it on the php page -

      $WAFV_Errors .= WAValidateRX((isset($_POST["Hidden_Field"])?$_POST["Hidden_Field"]:"" ) . "","/.* /",false,5);

      if ($WAFV_Errors != "")  {

        PostResult($WAFV_Redirect,$WAFV_Errors,"formtoemail");

      }

    }

    Not sure what that does to be honest.

    Seems to me all you really need is to make sure the form is not submitted by a spam bot.

    The form seems to work up until the point of the spam security validation.

    You could try adding an additional hidden form field after the current hidden form field:

    <input type="hidden" name="antiSpam">

    Then insert the below at the beginning of your form-to-email.php file after the opening <?php tag. If a spam bot populates the field then the 'exit;' php command should terminate the php file processing any further and the information never gets sent to the recipients email address - job done.

    // check antiSpam form field

    $antiSpam = trim($_POST['antiSpam']);

    if (!empty($antiSpam)) {

        exit;

    }

    As said in my last post you can test by temporary making the hidden field a normal <input type="text" form field.

    If this works then you can get rid of the captcha


    Ok so it seems that if i enter anything into the the hidden field the page wont submit, it just sends you back to the page again. Also the captcha validation works, if i enter the wrong code the page reloads flagging up in red that the wrong code was entered. Anyway i can now remove the captcha.

    Thank you! Happy New Year!