Parse error: syntax error, unexpected T_VARIABLE in D:\Hosting\7659316\html\sendmail.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Janie Kappler
    New Member
    • Mar 2011
    • 3

    Parse error: syntax error, unexpected T_VARIABLE in D:\Hosting\7659316\html\sendmail.

    My host service is with GoDaddy.com, don't know if that has any bearing on my problem but suspecting it might. My goal is to provide the site visitor a registration form to complete, click submit and get a feed back page plus have the form emailed to the administrator. I first set up the coding where the visitor gets the feed back page which worked beautifully. Once I put the coding for the email to be sent then I get the error which says it lies in Line 13. I have read that these errors are not always accurate on where the error is located. So I put a space on line 13, upload the new page but still same error on same line. Your help is very much appreciated.

    Code:
    <?php
    $name = $_POST['name'];
    $phone = $_POST['phone'];
    $email = $_POST['email'];
    $guest = $_POST['guest'];
    $guestphone = $_POST['guestphone'];
    $guestclub = $_POST['guestclub'];
    $guestclubphone = $_POST['guestclubphone'];
    $cash = $_POST['cash'];
    $check = $_POST['check'];
    $chgtoclub = $_POST['chgtoclub'];
    $specialrequest = $_POST['specialrequest']
    
    $message = "Registration form for Diamond Cup tournament. \n
    Name: $name \n
    Phone Number: $phone \n
    Email: $email \n
    Guest Name: $guest \n
    Guest Phone Number: $guestphone \n
    Guest Club: $guestclub \n
    Guest Club Phone: $guestclubphone \n
    Cash: $cash \n
    Check: $check \n
    Club Charge: $chgtoclub \n
    Special Request: $specialrequest";
    abs(
    $from = "From: $email";
    mail ('jkappler@sbcglobal.net', 'Diamond Cup', $message, $from);
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Diamond Cup Submit Registration Confirmation</title>
    <link href="dc.css" rel="stylesheet" type="text/css">
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css">
    </head>
    
    <body class="oneColElsCtrHdr">
    
    <div id="container">
      <div id="header">
        <img src="DC images/diamond _cup_logo_with_purple1.png" alt="Diamond Cup logo" width="200" height="219" class="oneColElsCtrHdr">
        <div class="Logo">June 16th, 17th, and 18th, 2011<br>
          Rolling Hills Country Club<br>
          Arlington, TX
        <!-- end #header -->
       
    
      <div id="mainContent">
        <h1>
        <p>&nbsp;  </p>
        <p class="p">Thank you for submitting your registration form.  <br>
        Once I have received your payment I will email you a confirmation of your completed enrollment. Happy Golfing!</p>
        <h1>The information you have submitted is:</h1>
        <p>Member Name:  <?php echo $name; ?></p>
        <p>Phone Number:  <?php echo $phone; ?></p>
        <p>Email:  <?php echo $email; ?></p>
        <p>Guest Name:  <?php echo $guest; ?></p>
        <p>Guest Phone Number:  <?php echo $guestphone; ?></p>
        <p>Guest Club Affiliation for Handicap Info:  <?php echo $guestclub; ?></p>
        <p>Guest Club Phone Number:  <?php echo $guestclubphone; ?></p>
        <p>Payment Method</p>
        <p>Cash: <?php echo $cash; ?></p>
        <p>Check:  <?php echo $check; ?></p>
        <p>Charge to RHCC member account:  <?php echo $chgtoclub; ?></p>
        <p>Special request or needs:    <?php echo $specialrequest; ?></p>
    	<!-- end #mainContent --></div>
      <div id="footer">
        <p>Rolling Hills Country Club - 401 East Lamar Boulevard, Arlington, TX 76011 <br>
          817-274-1072       <br>
          Pro Shop 817-261-6221
        </p>
      <!-- end #footer --></div>
    <!-- end #container --></div>
    </body>
    </html>
    Last edited by Dormilich; Mar 30 '11, 11:39 AM. Reason: please use [CODE] [/CODE] tags when posting code
  • Mayur2007
    New Member
    • Aug 2007
    • 67

    #2
    Hi,

    In your code check the below line
    Code:
    $specialrequest = $_POST['specialrequest']
    put semicolon after it. Might be your problem will be solved.

    Thanks,
    Mayur Bhayani

    Comment

    • Janie Kappler
      New Member
      • Mar 2011
      • 3

      #3
      Thank you that did work. But now I am dealing with a new problem on the same script. The email I receive back with the registers information, all the information is contained in the "Subject" line rather than the message area. I have tweeked around so much with no luck. Any ideas.

      Comment

      • Mayur2007
        New Member
        • Aug 2007
        • 67

        #4
        Hello,

        Use the headers (check sample below) instead of $from in your mail function.

        Code:
        // To send HTML mail, the Content-type header must be set
        $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        
        // Additional headers
        $headers .= 'To: Mary <mary@example.com>' . "\r\n";
        $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
        so your mail function would be like this

        Code:
        mail ('jkappler@sbcglobal.net', 'Diamond Cup', $message, $headers);
        check and let me know if any problem.

        Regards,
        Mayur Bhayani

        Comment

        • Janie Kappler
          New Member
          • Mar 2011
          • 3

          #5
          First off thank you for helping me. It is working the way I am wanting except now when I get the email their registering name is not included in the message area.
          This is what I get:
          From: noreply@secures erver.net
          To: registration@di amondcuptournam ent.com
          Subject: Diamond Cup Registration
          (in the following message area I get all except their name)
          Phone Number: '817-555-5555'
          Email: 'liz@yahoo.com'
          Guest Name: 'Robert Burton'
          Guest Phone Number: '817-555-5555'
          Guest Club: 'Green Acres Country Club'
          Guest Club Phone: '817-555-5555'
          Cash: ''
          Check: 'yes'
          Club Charge: ''
          Special Request: 'I have food allergies'
          Registration form for Diamond Cup tournament.[/B]

          Here is the revised code.

          <?php
          $name = $_POST['name'];
          $phone = $_POST['phone'];
          $email = $_POST['email'];
          $guest = $_POST['guest'];
          $guestphone = $_POST['guestphone'];
          $guestclub = $_POST['guestclub'];
          $guestclubphone = $_POST['guestclubphone '];
          $cash = $_POST['cash'];
          $check = $_POST['check'];
          $chgtoclub = $_POST['chgtoclub'];
          $specialrequest = $_POST['specialrequest '];

          $headers =
          "Name: '$name' \n
          Phone Number: '$phone' \n
          Email: '$email' \n
          Guest Name: '$guest' \n
          Guest Phone Number: '$guestphone' \n
          Guest Club: '$guestclub' \n
          Guest Club Phone: '$guestclubphon e' \n
          Cash: '$cash' \n
          Check: '$check' \n
          Club Charge: '$chgtoclub'\n
          Special Request: '$specialreques t'";
          $message = "Registrati on form for Diamond Cup tournament.";

          mail ('registration@ diamondcuptourn ament.com', 'Diamond Cup Registration', $message, $headers );
          ?>
          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
          <html>
          <head>
          <meta http-equiv="Content-Type" $headers = 'MIME-Version: 1.0' . "\r\n";
          <title>Diamon d Cup Submit Registration Confirmation</title>
          <link href="dc.css" rel="stylesheet " type="text/css">
          <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
          <link href="SpryAsset s/SpryMenuBarHori zontal.css" rel="stylesheet " type="text/css">
          </head>

          <body class="oneColEl sCtrHdr">
          <div id="container" >
          <div id="header">
          <img src="DC images/diamond _cup_logo_with_ purple1.png" alt="Diamond Cup logo" width="200" height="219" class="oneColEl sCtrHdr" />
          </div>
          <div class="Logo2">J une 16th, 17th, and 18th, 2011</br>
          Rolling Hills Country Club</br >
          Arlington, TX
          </div>
          <div id="mainContent ">
          <h1>
          <p class="p">Thank you for submitting your registration form. <br>
          Once I have received your payment I will email you a confirmation of your completed enrollment. Happy Golfing!</p>
          <p>The information you have submitted is:</p>
          <p>Member Name: <?php echo $name; ?></p>
          <p>Phone Number: <?php echo $phone; ?></p>
          <p>Email: <?php echo $email; ?></p>
          <p>Guest Name: <?php echo $guest; ?></p>
          <p>Guest Phone Number: <?php echo $guestphone; ?></p>
          <p>Guest Club Affiliation for Handicap Info: <?php echo $guestclub; ?></p>
          <p>Guest Club Phone Number: <?php echo $guestclubphone ; ?></p>
          <p>Payment Method</p>
          <p>Cash: <?php echo $cash; ?></p>
          <p>Check: <?php echo $check; ?></p>
          <p>Charge to RHCC member account: <?php echo $chgtoclub; ?></p>
          <p>Special request or needs: <?php echo $specialrequest ; ?></p>
          <h1>You can click the back button to return to the site and not loose your registration.</h1>
          </div>
          <div id="footer">
          <p>Rolling Hills Country Club - 401 East Lamar Boulevard, Arlington, TX 76011 <br>
          817-274-1072 <br>
          Pro Shop 817-261-6221
          </p>
          </div>
          </div>
          </body>
          </html>

          Comment

          • Mayur2007
            New Member
            • Aug 2007
            • 67

            #6
            Hello,

            I think there is no problem in code just confirm your variable name and post variable names. Also remove or write proper meta tag in header section.

            Regards,
            Mayur Bhayani

            Comment

            Working...