473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $name = $_POST['name'];
  3. $phone = $_POST['phone'];
  4. $email = $_POST['email'];
  5. $guest = $_POST['guest'];
  6. $guestphone = $_POST['guestphone'];
  7. $guestclub = $_POST['guestclub'];
  8. $guestclubphone = $_POST['guestclubphone'];
  9. $cash = $_POST['cash'];
  10. $check = $_POST['check'];
  11. $chgtoclub = $_POST['chgtoclub'];
  12. $specialrequest = $_POST['specialrequest']
  13.  
  14. $message = "Registration form for Diamond Cup tournament. \n
  15. Name: $name \n
  16. Phone Number: $phone \n
  17. Email: $email \n
  18. Guest Name: $guest \n
  19. Guest Phone Number: $guestphone \n
  20. Guest Club: $guestclub \n
  21. Guest Club Phone: $guestclubphone \n
  22. Cash: $cash \n
  23. Check: $check \n
  24. Club Charge: $chgtoclub \n
  25. Special Request: $specialrequest";
  26. abs(
  27. $from = "From: $email";
  28. mail ('jkappler@sbcglobal.net', 'Diamond Cup', $message, $from);
  29. ?>
  30. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  31. <html>
  32. <head>
  33. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  34. <title>Diamond Cup Submit Registration Confirmation</title>
  35. <link href="dc.css" rel="stylesheet" type="text/css">
  36. <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
  37. <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css">
  38. </head>
  39.  
  40. <body class="oneColElsCtrHdr">
  41.  
  42. <div id="container">
  43.   <div id="header">
  44.     <img src="DC images/diamond _cup_logo_with_purple1.png" alt="Diamond Cup logo" width="200" height="219" class="oneColElsCtrHdr">
  45.     <div class="Logo">June 16th, 17th, and 18th, 2011<br>
  46.       Rolling Hills Country Club<br>
  47.       Arlington, TX
  48.     <!-- end #header -->
  49.  
  50.  
  51.   <div id="mainContent">
  52.     <h1>
  53.     <p>&nbsp;  </p>
  54.     <p class="p">Thank you for submitting your registration form.  <br>
  55.     Once I have received your payment I will email you a confirmation of your completed enrollment. Happy Golfing!</p>
  56.     <h1>The information you have submitted is:</h1>
  57.     <p>Member Name:  <?php echo $name; ?></p>
  58.     <p>Phone Number:  <?php echo $phone; ?></p>
  59.     <p>Email:  <?php echo $email; ?></p>
  60.     <p>Guest Name:  <?php echo $guest; ?></p>
  61.     <p>Guest Phone Number:  <?php echo $guestphone; ?></p>
  62.     <p>Guest Club Affiliation for Handicap Info:  <?php echo $guestclub; ?></p>
  63.     <p>Guest Club Phone Number:  <?php echo $guestclubphone; ?></p>
  64.     <p>Payment Method</p>
  65.     <p>Cash: <?php echo $cash; ?></p>
  66.     <p>Check:  <?php echo $check; ?></p>
  67.     <p>Charge to RHCC member account:  <?php echo $chgtoclub; ?></p>
  68.     <p>Special request or needs:    <?php echo $specialrequest; ?></p>
  69.     <!-- end #mainContent --></div>
  70.   <div id="footer">
  71.     <p>Rolling Hills Country Club - 401 East Lamar Boulevard, Arlington, TX 76011 <br>
  72.       817-274-1072       <br>
  73.       Pro Shop 817-261-6221
  74.     </p>
  75.   <!-- end #footer --></div>
  76. <!-- end #container --></div>
  77. </body>
  78. </html>
Mar 29 '11 #1
5 3215
Hi,

In your code check the below line
Expand|Select|Wrap|Line Numbers
  1. $specialrequest = $_POST['specialrequest']
  2.  
put semicolon after it. Might be your problem will be solved.

Thanks,
Mayur Bhayani
Mar 30 '11 #2
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.
Mar 30 '11 #3
Hello,

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

Expand|Select|Wrap|Line Numbers
  1. // To send HTML mail, the Content-type header must be set
  2. $headers  = 'MIME-Version: 1.0' . "\r\n";
  3. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  4.  
  5. // Additional headers
  6. $headers .= 'To: Mary <mary@example.com>' . "\r\n";
  7. $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
  8.  
so your mail function would be like this

Expand|Select|Wrap|Line Numbers
  1. mail ('jkappler@sbcglobal.net', 'Diamond Cup', $message, $headers);
  2.  
check and let me know if any problem.

Regards,
Mayur Bhayani
Mar 31 '11 #4
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@secureserver.net
To: registration@diamondcuptournament.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: '$guestclubphone' \n
Cash: '$cash' \n
Check: '$check' \n
Club Charge: '$chgtoclub'\n
Special Request: '$specialrequest'";
$message = "Registration form for Diamond Cup tournament.";

mail ('registration@diamondcuptournament.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>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>
<div class="Logo2">June 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>
Mar 31 '11 #5
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
Apr 1 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Wescotte | last post by:
The error message Parse error: syntax error, unexpected $end in FILE on line X is one I run into frequently and I know the cause is I missed an ending quote. Is there an easy way to determine...
36
by: rhys | last post by:
My Gurus and Angels -- Please pardon this old-school programmer, only recently enlightened to open-source, having been trapped in the convenience of proprietary lingos for way too long. My...
3
by: SilvaZodiac | last post by:
Hi everyone, I'm still rather new to PHP code, and I have a syntax error. I've tried several different solutions, but it won't fix. It seems to suggest that I need a new bracket somewhere in the...
2
by: fburn | last post by:
I need some help with an error I'm getting using php 5.2.5 running on linux. I receive an error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or...
9
akohistani
by: akohistani | last post by:
I am having Parse error problem with my newly purchased Php upload script I have uploaded the script and I get the error below Parse error: syntax error, unexpected $end in URL/functions.php on...
3
paulrajj
by: paulrajj | last post by:
hi to all, i am getting syntax error on my code.. Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\xampp\htdocs\Dummy\paulraj\matrim\exam.php on line 62 ...
10
by: benicio | last post by:
Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\wamp\www\study_group\includes\functions.php on line 19 I got this error and this syntax is from 8 to 19th line. <?php ...
3
by: brkseven | last post by:
Looking for help with this Contact Form. The error is on line 1, but that' doesn't mean a lot, I think. In fact, a php syntax check passed it, but I was hoping for an easy syntax error, it looks...
3
by: CYNTHIA CUTRER | last post by:
<!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" xml:lang="en"> <head> ...
2
by: Vicki Hendra | last post by:
Hi I am new to php fullstop I and colleagues have setup wordpress blogs for our local towns, giving the local businesses free advertisment. Part of the problem started when using wordpress...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.