1 Reply Latest reply on Mar 8, 2010 9:48 AM by nmbnmb

    Parse error when trying to use form

    owenpga2 Level 1

      When i load the PHP,form page and thank you page im getting this error when i hit send.

      No email is sent from form.

       

      Parse error: syntax error, unexpected T_STRING in /home/owendaws/public_html/owendawsonpga/contactformprocess_original_db.php on line 38

       

       

      PHP page

       

      <?

       

      $fname = $HTTP_POST_VARS['textfield'];

       

      $lname = $HTTP_POST_VARS['textfield2'];

       

      $phone = $HTTP_POST_VARS['textfield3'];

       

      $email = $HTTP_POST_VARS['textfield4'];

       

      $address = $HTTP_POST_VARS['textfield5'];

       

      $state = $HTTP_POST_VARS['textfield6'];

       

      $zip = $HTTP_POST_VARS['textfield7'];

       

      $find = $HTTP_POST_VARS['select'];

       

      $goals = $HTTP_POST_VARS['select2'];

       

      $practice = $HTTP_POST_VARS['select3'];

       

      $learn = $HTTP_POST_VARS['select4'];

       

      $handicap = $HTTP_POST_VARS['select5'];

       

      $timeplaying = $HTTP_POST_VARS['select6'];

       

      $lesson = $HTTP_POST_VARS['select7'];

       

      $additional = $HTTP_POST_VARS['textfield8'];

       

       

      mail('owenpga@comcast.net','Owen Dawson PGA Contact Form Submission',"First Name: $fname\nLast Name: $lname\nPhone Number: $phone\nEmail: $email\nAddress: $address\nState: $state\nZip Code: $zip\nHow did you find me? $find\nWhat are your goals? $goals\nHow much can you practice? $practice\nWhat would you like to learn? $learn\nWhat is your handicap? $handicap\nHow long have you been playing golf? $timeplaying\nHave you ever taken a lesson? $lesson\nAdditional Information: $additional\n",'From: owenpga@comcast.net');

       

       

      header("Location: http://www.owendawsonpga.com/thankyouform.html");

       

       

      ?>

       

      ________________________________________________________________________________ ____________________________

       


      form page

       

      <!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"><!-- InstanceBegin template="/Templates/PGATEMPLATE3.dwt" codeOutsideHTMLIsLocked="false" -->
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <!-- InstanceBeginEditable name="doctitle" -->
      <title>Golf Lessons in Baltimore Owen Dawson PGA, GOLF INSTRUCTION IN MARYLAND, GOLF LESSONS IN BALTIMORE</title>
      <meta name="Keywords" content="GOLF INSTRUCTION, GOLF LESSONS IN BALTIMORE, BALTIMORE, MARYLAND, GOLF INSTRUCTION BALTIMORE,SHORT GAME,BUNKER PLAY" />
      <meta name="Description" content="Golf Instruction in Baltimore Maryland" />
      <!-- InstanceEndEditable -->
      <link href="twoColFixRtHdr.css" rel="stylesheet" type="text/css" />
      <!--[if IE 5]>
      <style type="text/css">
      /* place css box model fixes for IE 5* in this conditional comment */
      .twoColFixRtHdr #sidebar1 { width: 220px; }
      </style>
      <![endif]--><!--[if IE]>
      <style type="text/css">
      /* place css fixes for all versions of IE in this conditional comment */
      .twoColFixRtHdr #sidebar1 { padding-top: 30px; }
      .twoColFixRtHdr #mainContent { zoom: 1; }
      /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
      </style>
      <![endif]-->
      <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
      <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
      <style type="text/css">
      <!--
      .style1 {
          font-size: small
      }
      .style2 {
          font-family: "Comic Sans MS", Papyrus;
          font-size: small;
      }
      .style6 {font-size: smaller; font-family: "Comic Sans MS", Papyrus; }
      .style7 {font-family: "Comic Sans MS", Papyrus}
      .style8 {
          color: #0000FF;
          font-family: Georgia, "Times New Roman", Times, serif;
      }
      a:link {
          text-decoration: none;
          color: #000000;
          background-color: #EBEBEB;
      }
      a:visited {
          text-decoration: none;
          color: #000000;
      }
      a:hover {
          text-decoration: none;
          border-top-style: none;
          border-right-style: none;
          border-bottom-style: none;
          border-left-style: none;
          border-top-color: #001EF1;
          border-right-color: #001EF1;
          border-bottom-color: #001EF1;
          border-left-color: #001EF1;
          color: #000000;
          background-color: #EBEBEB;
      }
      a:active {
          text-decoration: none;
      }
      .style9 {font-family: Georgia, "Times New Roman", Times, serif}
      .style10 {font-family: Georgia, "Times New Roman", Times, serif; font-size: small; }
      .style11 {color: #000000}
      .style12 {
          font-family: Georgia, "Times New Roman", Times, serif;
          color: #FF0000;
          font-weight: bold;
      }
      .style13 {color: #FF0000}
      -->
      </style>
      <!-- InstanceBeginEditable name="head" -->
      <script type="text/javascript">
      function submitForm(){
          var myform = document.getElementById('form1');
          var fname = document.getElementById('textfield');
          var lname = document.getElementById('textfield2');
          var phone = document.getElementById('textfield3');
         
          if (fname.value == ''){
              alert('First name is a required field.  Please enter your first name to continue.');
              fname.focus();
              return false;
          }
          if (lname.value == ''){
              alert('Last name is a required field.  Please enter your last name to continue.');
              fname.focus();
              return false;
          }
          if (phone.value == ''){
              alert('Phone number is a required field.  Please enter your preferred phone number to continue.');
              fname.focus();
              return false;
          }
          myform.submit();
      }

       

      function messageSent(){
          var status = document.getElementById('msg');
          status.innerHTML = 'Message sent successfully.';
      }
      </script>
      <!-- InstanceEndEditable -->
      </head>

       

      <body class="twoColFixRtHdr">

       

      <div id="container">
        <div id="header">
          <h1><img src="photos/newpgabannerfinal3_2_10.png" width="739" height="210" /></h1>
          <!-- InstanceBeginEditable name="EditRegion4" -->
          <ul id="MenuBar1" class="MenuBarHorizontal">
            <li><a href="V1Login.html" class="style1">V1 Student Videos</a></li>
            <li><a href="Private_Lessons.html" class="style1">Private Lessons</a></li>
            <li><a href="Clinics.html" class="style1">Clinics</a></li>
            <li><a href="Gift_Certificates.html" class="style1">Gift Certificates</a></li>
            <li><a href="Instructional_Video.html" class="style1">Instructional Video</a></li>
            <li><a href="mailto:owenpga@comcast.net" class="style1">Contact Owen</a></li>
          </ul>
          <!-- InstanceEndEditable -->
          <p align="center"> </p>
        <!-- end #header --></div>
       
        <div id="sidebar1">
          <p class="style12"><a href="newfor2010.html" class="style13">New V1 Swing Analysis Software for 2010</a></p>
          <p class="style7"><a href="contactformprocess_original_db.html">Instructional Form </a></p>
          <p class="style7"><span class="style9"><span class="style9"><a href="Sample_Lesson.html">Sample Lesson</a></span></span></p>
          <p class="style9"><a href="http://www.youtube.com/user/owenpga" target="_blank">Video tutorials</a></p>
          <p class="style9"><a href="http://owendawsonpga.blogspot.com" target="_blank">Instructional Blog</a></p>
          <p class="style7 style8"><a href="PGAPHOTOGALLERY/index.html" target="_blank" class="style9">Photo Gallery</a></p>
          <p class="style7 style8 style11"><a href="Instructional_Video.html">Intructional Video</a></p>
          <p class="style7 style8"> </p>
          <p class="style10">Testimonials</p>
          <p class="style6 style9">“I have been working with Owen Dawson for the past 7 years. During that time my swing has dramatically changed and improved. This has happened through Owen's drills and use of video. It is because of these techniques, that I understand how to hit good shots but just as importantly why I hit a shot poorly. I’m glad I’ve had the opportunity to work with Owen and would highly recommend him. ” <strong>Sam Young - Country Club of Maryland - 2009 Men's Club Champion </strong></p>
          <p class="style2">.............................................</p>
          <p class="style6 style9">“Owen does two things  particularly well, in my opinion.  First, he is a master of recording  technology, and it really helps me to see what I need correcting, and what the  new move needs to be.  Second, Owen knows what the best next step should be  in your own journey to a better swing.  I have taken one or two lessons  from Owen each year for the last three or four years – one relatively small  step at a time, and then worked on grooving that step.  In that period, my  index has dropped about 8 strokes, and in 2007 I won the Club’s “Most Improved  Player” award.  Kudos to Owen!”</p>
          <p class="style6 style9"><strong>Bill Smillie -CCofMD</strong></p>
          <h3 class="style2"><a href="Testimonials.html">Read other testimonials  </a></h3>
          <!-- end #sidebar1 -->
        </div>
        <!-- InstanceBeginEditable name="MAINCONTENT" -->
        <div id="mainContent">
            <form action="contactformprocess_original_db.php" method="post" enctype="multipart/form-data" name="form1" id="form1" target="ifr">
            <p class="style5">Name</p>
            <p>
              <label for="textfield"><span class="style5">First</span></label>
              <input type="text" name="textfield" id="textfield" />
              </p>
            <p>
              <label for="textfield2"><span class="style5">Last</span></label>
              <input type="text" name="textfield2" id="textfield2" />
            </p>
            <p><span class="style5">Phone number
                <label>
                <input type="text" name="textfield3" id="textfield3" />
                </label>
            </span></p>
            <p><span class="style5">Email</span>
              <label>
              <input type="text" name="textfield4" id="textfield4" />
              </label>
            </p>
            <p><span class="style5">Address
                <label>
                <input type="text" name="textfield5" id="textfield5" />
                </label>
            </span></p>
            <p><span class="style5">State</span>
              <label>
              <input type="text" name="textfield6" id="textfield6" />
              </label>
            </p>
            <p><span class="style5">Zip Code</span>
              <label>
              <input type="text" name="textfield7" id="textfield7" />
              </label>
            </p>
            <p><span class="style5">How did you find me?</span>
              <label for="select"></label>
              <select name="select" id="select">
                <option value="internet">Internet Search</option>
                <option value="friend referral">Friend Referral</option>
                <option value="ccmdsite">Country Club of MD website</option>
                <option value="other">Other</option>
              </select>
            </p>
            <p><span class="style5">What are your golfing goals?</span>            
              <select name="select2" id="select2">
                <option value="break 100">Break 100</option>
                <option value="break 90">Break 90</option>
                <option value="break 80">Break 80</option>
                <option value="stop slice">Stop Slicing the Ball</option>
                <option value="stop hook">Stop Hooking the Ball</option>
                <option value="Compete">Compete in local tournaments</option>
                <option value="More Consistant">Hit more consistant shots</option>
              </select>
            </p>
            <p><span class="style5">How much can you practice?</span>
              <label for="select3"></label>
              <select name="select3" id="select3">
                <option value="1 hour">1 hour</option>
                <option value="2 hours">2 hours</option>
                <option value="3 hours">3 hours </option>
                <option value="> 3 hours">More than 3 hours a week</option>
              </select>
            </p>
            <p><span class="style5">What would you like to learn?</span>
              <label for="select4"></label>
              <select name="select4" id="select4">
                <option value="full swing">Full Swing Mechanics Irons</option>
                <option value="driver swing">Full Swing Mechanics Driver</option>
                <option value="short pitches">Short Pitch Shots inside of 50 yards</option>
                <option value="bunker play">Bunker Play</option>
                <option value="chipping">Chipping</option>
                <option value="short shots">Short shots from rough</option>
              </select>
            </p>
            <p class="style5">What is your Handicap?<label for="select5"></label>
              <select name="select5" id="select5">
                <option value="scratch to 5">Scratch - 5 HDCP</option>
                <option value="6 to 10">6 - 10 HDCP</option>
                <option value="11 to 15">11 - 15 HDCP</option>
                <option value="15 to 20">15 - 20 HDCP</option>
                <option value="> 21">21 and Higher</option>
              </select>
            </p>
            <p class="style5">How long have you been playing?
              <label for="select6"></label>
              <select name="select6" id="select6">
                <option value="beginner">Beginner</option>
                <option value="2 to 5 years">2-5 yrs</option>
                <option value="6 to 10 years">6-10 yrs</option>
                <option value="11 to 15 years">11-15yrs</option>
                <option value="> 15 years">More than 15 years</option>
              </select>
            </p>
            <p class="style5">Have you ever had a lesson?
              <label for="select7"></label>
              <select name="select7" id="select7">
                <option value="yes">YES</option>
                <option value="no">NO</option>
              </select>
            </p>
            <p class="style5">Additional Information
              <label>
              <textarea name="textfield8" cols="40" id="textfield8"></textarea>
              </label>
            </p>
            <p class="style5">
              <label for="button"></label>
              <input type="submit" name="Submit" id="button" value="Submit"onclick="submitForm()" />
            </p>
            <p class="style5"> </p>
              <div id="msg" style="font: bold 12px arial"></div>
         
          </form>
          <p align="center" class="style8"><br />
          </p>
          <p class="style8"> </p>
          <p class="style8"> </p>
          <p class="style8 style12"><strong><br />
           </strong></p>
          <p align="left"> </p>
          <h1> </h1>
          <!-- end #mainContent -->
          </div>
        <!-- InstanceEndEditable -->
        <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats -->
        <br class="clearfloat" />
       
        <div id="footer">
          <p align="center"><a href="http://www.v1golf.com" target="_blank"><img src="photos/GAW.png" width="163" height="60" hspace="20" border="0" /><img src="photos/logo.png" width="80" height="76" hspace="40" border="0" /></a><a href="http://www.owendawsonphotography.com" target="_blank"><img src="photos/ody.png" width="199" height="59" border="0" /></a></p>
          <h2 align="center" class="style6">©Owen Dawson P.G.A. ™ All rights reserved</h2>
          <!-- end #footer -->
        </div>
      <!-- end #container --></div>
      <script type="text/javascript">
      <!--
      var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
      //-->
      </script>
      </body>
      <!-- InstanceEnd --></html>

       

      ________________________________________________________________________________ ______________________________________

       

      thank you page

       

      <!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>
      </head>

       

      <body>
      Thank you for fill out my lesson form. I will be in touch with you shortly. Owen
      </body>
      </html>

        • 1. Re: Parse error when trying to use form
          nmbnmb Level 2

          Your PHP script is not secured at all. I would recommend using Forms To Go (http://www.bebosoft.com/products/formstogo/overview) to create the PHP script.

           

          The unregistered version can be used for free. It will get you up and running in no time.

           

          In your HTML form,remove enctype="multipart/form-data" from this:

           

          <form action="contactformprocess_original_db.php" method="post" enctype="multipart/form-data" name="form1" id="form1" target="ifr">

           

          enctype="multipart/form-data" is only required if you have a file upload field in the form.