[SOLVED] parse error, unexpected T_EXIT in php mail script

This is a discussion on "[SOLVED] parse error, unexpected T_EXIT in php mail script" within the PHP Forum section. This forum, and the thread "[SOLVED] parse error, unexpected T_EXIT in php mail script are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 12th, 2007, 06:53
Junior Member
Join Date: Nov 2007
Location: Oregon
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] parse error, unexpected T_EXIT in php mail script

I have created a hmlt/php consultation form (which works fine) that sends to this php script to send the results to me via email.

No matter what I try, I keep getting this error message:
Parse error: parse error, unexpected T_EXIT, expecting ',' or ';' in /homepages/36/d222381006/htdocs/consultemail.php on line 65

Can anyone see anything obvious that I am missing?

(Sorry for all the variables)

Thank you so much in advance for your help!

PHP: Select all

<?php

$bride 
$_POST["bride"];
$groom $_POST["groom"];
$brideemail $_POST["brideemail"];
$date $_POST["date"];
$time $_POST["time"];
$ceremony $_POST["ceremony"];
$location1 $_POST["location1"];
$city $_POST["city"];
$reception $_POST["reception"];
$time2 $_POST["time2"];
$location2 $_POST["location2"];
$bridephone $_POST["bridephone"];
$groomphone $_POST["groomphone"];
$flowerbride $_POST["flowerbride"];
$colorbride $_POST["colorbride"];
$flowernotbride $_POST["flowernotbride"];
$colornotbride $_POST["colornotbride"];
$flowergroom $_POST["flowergroom"];
$colorgroom $_POST["colorgroom"];
$flowernotgroom $_POST["flowernotgroom"];
$colornotgroom $_POST["colornotgroom"];
$allergies $_POST["allergies"];
$allergicto $_POST["allergicto"];
$hobbies $_POST["hobbies"];
$maids $_POST["maids"];
$maidgowns $_POST["maidgowns"];
$men $_POST["men"];
$menswear $_POST["menswear"];
$children $_POST["children"];
$gown $_POST["gown"];
$groomswear $_POST["groomswear"];
$style $_POST["style"];
$trendy $_POST["trendy"];
$romantic $_POST["romantic"];
$traditional $_POST["traditional"];
$exotic $_POST["exotic"];
$natural $_POST["natural"];
$dreamy $_POST["dreamy"];
$clean $_POST["clean"];
$classic $_POST["classic"];
$extravagant $_POST["extravagant"];
$lush $_POST["lush"];
$simple $_POST["simple"];
$soft $_POST["soft"];
$bright $_POST["bright"];
$artistic $_POST["artistic"];
$green $_POST["green"];
$unique $_POST["unique"];
$glamorous $_POST["glamorous"];
$sophisticated $_POST["sophisticated"];
$earthy $_POST["earthy"];
$detailed $_POST["detailed"];
$eclectic $_POST["eclectic"];
$glitzy $_POST["glitzy"];
$festive $_POST["festive"];
$garden $_POST["garden"];
$westcoast $_POST["westcoast"];
$boho $_POST["boho"];
$magical $_POST["magical"];
$ethnic $_POST["ethnic"];
$modern $_POST["modern"];
$timeless $_POST["timeless"];
$styledesc $_POST["styledesc"];
$wantflowers $_POST["wantflowers"];
$importance $_POST["importance"];
$personal $_POST["personal"];
$cerflowers $_POST["cerflowers"];
$recflowers $_POST["recflowers"];
$linens $_POST["linens"];
$rentals $_POST["rentals"];
$setup $_POST["setup"];
$budget $_POST["budget"];
# This part submits a notification when 
# the form is submitted
// Email address for copies to be sent to - 
$emailto "[email="michellemc5@clearwire.net"]michellemc5@clearwire.net[/email]"
// Notification email subject text for copies
$esubject "consultation form submission"
// Email body text for notifications
$emailtext " $bride has submitted a consultation request using an email address of $brideemail \n
$bride and $groom are planning a wedding for $date at $time \n
$ceremony at $location1 in $city. \n
The reception will be $reception at $time2 at $location2.\n
$bride can be contacted at $brideemail and $bridephone.  \n
$groom can be contacted at $groomphone. \n
The bride likes $flowerbride flowers and the color $colorbride.  \n
She DISLIKES $flowernotbride flowers and the color $colornotbride. \n
The groom likes $flowergroom flowers and the color $colorgroom. \n
He DISLIKES $flowernotgroom flowers and the color $colornotgroom. \n
Allergies? $allergies  If yes, specify $allergicto \n
The couple enjoys $hobbies.\n
The $maids bridesmaids will be wearing $maidgowns \n
and the $men groomsmen will be wearing $menswear. \n
There will be other bridal party members of $children. \n
The bride's gown is $gown. \n
The groom's attire is $groomswear.\n
The wedding will be $style.\n
The wedding style can be described as $trendy, $romantic, $traditional, $exotic, $natural, \n
$dreamy, $clean, $classic, $extravagant, $lush, $simple, $soft, \n
$bright, $artistic, $green, $unique, $glamorous, $sophisticated, $earthy, \n
$detailed, $eclectic, $glitzy, $festive, $garden, $westcoast, $boho, \n
$magical, $ethnic, $modern, $timeless \n
and $styledesc. \n
The bride's thoughts on the flowers she wants:  $wantflowers \n
She feels that flowers are important to her wedding: $importance \n
She would like us to provide:  $personal, $cerflowers, $recflowers, \n
$linens, $rentals, $setup \n
Her budget is $budget."
;
# This function sends the email 
@mail("$emailto""$esubject""$emailtext""From: $brideemail\n");
echo 
"The consultation form has been submitted.  $bride, we will contact you soon to set an appointment to discuss flowers for your $date wedding.  Thank you!";
exit();
?>

Last edited by Rakuli; Dec 12th, 2007 at 07:29. Reason: [code] became [php]
Reply With Quote

  #2 (permalink)  
Old Dec 12th, 2007, 07:35
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: parse error, unexpected T_EXIT in php mail script

Your problem starts here

PHP: Select all

$emailto "[email="michellemc5@clearwire.net"]michellemc5@clearwire.net[/email]"
You need to escape the double quotes

PHP: Select all

$emailto "[email=\"michellemc5@clearwire.net\"]michellemc5@clearwire.net[/email]"
Hope that helps
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
  #3 (permalink)  
Old Dec 12th, 2007, 08:00
Up'n'Coming Member
Join Date: Jun 2007
Location: Birmingham, UK
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Re: parse error, unexpected T_EXIT in php mail script

There is a serious security problem with your script.
The $brideemail variable is not checked for validity before being passed on in the email header. Anyone can easily inject fake headers and use your script for sending spam.

Check out one of the following sites, for how to validate emails

http://www.ilovejackdaniels.com/php/...ss-validation/

http://www.devshed.com/c/a/PHP/Email...tion-with-PHP/
Reply With Quote
  #4 (permalink)  
Old Dec 12th, 2007, 23:31
Junior Member
Join Date: Nov 2007
Location: Oregon
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Re: parse error, unexpected T_EXIT in php mail script

Thank you both!

I took the validation code out because I was having trouble getting the script to work and I thought I'd better get the basic one working then add it back in.

I made the change suggested in the e-mail line and got the following message:
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /homepages/36/d222381006/htdocs/consultemail.php on line 80

(Line 80 is the e-mail line we are changing)

I tried moving the second slash outside the quote mark and got the same result.

Do you know why this error might be happening?

Thanks again for all your help!
Reply With Quote
  #5 (permalink)  
Old Dec 12th, 2007, 23:48
alexgeek's Avatar
Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,771
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: parse error, unexpected T_EXIT in php mail script

Post your code, I want to see what it looks like now you've changed it.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #6 (permalink)  
Old Dec 13th, 2007, 00:04
Junior Member
Join Date: Nov 2007
Location: Oregon
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Re: parse error, unexpected T_EXIT in php mail script

Here it is again...

Code: Select all
<?php
$bride = $_POST["bride"];
$groom = $_POST["groom"];
$brideemail = $_POST["brideemail"];
$date = $_POST["date"];
$time = $_POST["time"];
$ceremony = $_POST["ceremony"];
$location1 = $_POST["location1"];
$city = $_POST["city"];
$reception = $_POST["reception"];
$time2 = $_POST["time2"];
$location2 = $_POST["location2"];
$bridephone = $_POST["bridephone"];
$groomphone = $_POST["groomphone"];
$flowerbride = $_POST["flowerbride"];
$colorbride = $_POST["colorbride"];
$flowernotbride = $_POST["flowernotbride"];
$colornotbride = $_POST["colornotbride"];
$flowergroom = $_POST["flowergroom"];
$colorgroom = $_POST["colorgroom"];
$flowernotgroom = $_POST["flowernotgroom"];
$colornotgroom = $_POST["colornotgroom"];
$allergies = $_POST["allergies"];
$allergicto = $_POST["allergicto"];
$hobbies = $_POST["hobbies"];
$maids = $_POST["maids"];
$maidgowns = $_POST["maidgowns"];
$men = $_POST["men"];
$menswear = $_POST["menswear"];
$children = $_POST["children"];
$gown = $_POST["gown"];
$groomswear = $_POST["groomswear"];
$style = $_POST["style"];
$trendy = $_POST["trendy"];
$romantic = $_POST["romantic"];
$traditional = $_POST["traditional"];
$exotic = $_POST["exotic"];
$natural = $_POST["natural"];
$dreamy = $_POST["dreamy"];
$clean = $_POST["clean"];
$classic = $_POST["classic"];
$extravagant = $_POST["extravagant"];
$lush = $_POST["lush"];
$simple = $_POST["simple"];
$soft = $_POST["soft"];
$bright = $_POST["bright"];
$artistic = $_POST["artistic"];
$green = $_POST["green"];
$unique = $_POST["unique"];
$glamorous = $_POST["glamorous"];
$sophisticated = $_POST["sophisticated"];
$earthy = $_POST["earthy"];
$detailed = $_POST["detailed"];
$eclectic = $_POST["eclectic"];
$glitzy = $_POST["glitzy"];
$festive = $_POST["festive"];
$garden = $_POST["garden"];
$westcoast = $_POST["westcoast"];
$boho = $_POST["boho"];
$magical = $_POST["magical"];
$ethnic = $_POST["ethnic"];
$modern = $_POST["modern"];
$timeless = $_POST["timeless"];
$styledesc = $_POST["styledesc"];
$wantflowers = $_POST["wantflowers"];
$importance = $_POST["importance"];
$personal = $_POST["personal"];
$cerflowers = $_POST["cerflowers"];
$recflowers = $_POST["recflowers"];
$linens = $_POST["linens"];
$rentals = $_POST["rentals"];
$setup = $_POST["setup"];
$budget = $_POST["budget"];
# This part submits a notification when 
# the form is submitted
// Email address for copies to be sent to - 
$emailto = "michellemc5@clearwire.net[/email">michellemc5@clearwire.net\"]michellemc5@clearwire.net"; 
// Notification email subject text for copies
$esubject = "consultation form submission"; 
// Email body text for notifications
$emailtext = " $bride has submitted a consultation request using an email address of $brideemail \n
$bride and $groom are planning a wedding for $date at $time \n
$ceremony at $location1 in $city. \n
The reception will be $reception at $time2 at $location2.\n
$bride can be contacted at $brideemail and $bridephone.  \n
$groom can be contacted at $groomphone. \n
The bride likes $flowerbride flowers and the color $colorbride.  \n
She DISLIKES $flowernotbride flowers and the color $colornotbride. \n
The groom likes $flowergroom flowers and the color $colorgroom. \n
He DISLIKES $flowernotgroom flowers and the color $colornotgroom. \n
Allergies? $allergies  If yes, specify $allergicto \n
The couple enjoys $hobbies.\n
The $maids bridesmaids will be wearing $maidgowns \n
and the $men groomsmen will be wearing $menswear. \n
There will be other bridal party members of $children. \n
The bride gown is $gown. \n
The groom attire is $groomswear.\n
The wedding will be $style.\n
The wedding style can be described as $trendy, $romantic, $traditional, $exotic, $natural, \n
$dreamy, $clean, $classic, $extravagant, $lush, $simple, $soft, \n
$bright, $artistic, $green, $unique, $glamorous, $sophisticated, $earthy, \n
$detailed, $eclectic, $glitzy, $festive, $garden, $westcoast, $boho, \n
$magical, $ethnic, $modern, $timeless \n
and $styledesc. \n
The brides thoughts on the flowers she wants:  $wantflowers \n
She feels that flowers are important to her wedding: $importance \n
She would like us to provide:  $personal, $cerflowers, $recflowers, \n
$linens, $rentals, $setup \n
Her budget is $budget.";
# This function sends the email 
@mail("$emailto", "$esubject", "$emailtext", "From: $brideemail\n");
echo "The consultation form has been submitted.  $bride, we will contact you soon to set an appointment to discuss flowers for your $date wedding.  Thank you!";
exit();
?>
Reply With Quote
  #7 (permalink)  
Old Dec 13th, 2007, 00:23
alexgeek's Avatar
Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,771
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: parse error, unexpected T_EXIT in php mail script

You haven't done what Rakuli said to do, follow his post.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #8 (permalink)  
Old Dec 13th, 2007, 01:27
Junior Member
Join Date: Nov 2007
Location: Oregon
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Re: parse error, unexpected T_EXIT in php mail script

So sorry -- I thought we were just talking about the one line.

I fixed it now (THANK YOU, THANK YOU!)

In case it helps anyone else, here's the script that works. But it brings up another question... I'll save that for a new post.

Code: Select all
<?php
$bride = $_POST['bride'];
$groom = $_POST['groom'];
$brideemail = $_POST['brideemail'];
$date = $_POST['date'];
$time = $_POST['time'];
$ceremony = $_POST['ceremony'];
$location1 = $_POST['location1'];
$city = $_POST['city'];
$reception = $_POST['reception'];
$time2 = $_POST['time2'];
$location2 = $_POST['location2'];
$bridephone = $_POST['bridephone'];
$groomphone = $_POST['groomphone'];
$flowerbride = $_POST['flowerbride'];
$colorbride = $_POST['colorbride'];
$flowernotbride = $_POST['flowernotbride'];
$colornotbride = $_POST['colornotbride'];
$flowergroom = $_POST['flowergroom'];
$colorgroom = $_POST['colorgroom'];
$flowernotgroom = $_POST['flowernotgroom'];
$colornotgroom = $_POST['colornotgroom'];
$allergies = $_POST['allergies'];
$allergicto = $_POST['allergicto'];
$hobbies = $_POST['hobbies'];
$maids = $_POST['maids'];
$maidgowns = $_POST['maidgowns'];
$men = $_POST['men'];
$menswear = $_POST['menswear'];
$children = $_POST['children'];
$gown = $_POST['gown'];
$groomswear = $_POST['groomswear'];
$style = $_POST['style'];
$trendy = $_POST['trendy'];
$romantic = $_POST['romantic'];
$traditional = $_POST['traditional'];
$exotic = $_POST['exotic'];
$natural = $_POST['natural'];
$dreamy = $_POST['dreamy'];
$clean = $_POST['clean'];
$classic = $_POST['classic'];
$extravagant = $_POST['extravagant'];
$lush = $_POST['lush'];
$simple = $_POST['simple'];
$soft = $_POST['soft'];
$bright = $_POST['bright'];
$artistic = $_POST['artistic'];
$green = $_POST['green'];
$unique = $_POST['unique'];
$glamorous = $_POST['glamorous'];
$sophisticated = $_POST['sophisticated'];
$earthy = $_POST['earthy'];
$detailed = $_POST['detailed'];
$eclectic = $_POST['eclectic'];
$glitzy = $_POST['glitzy'];
$festive = $_POST['festive'];
$garden = $_POST['garden'];
$westcoast = $_POST['westcoast'];
$boho = $_POST['boho'];
$magical = $_POST['magical'];
$ethnic = $_POST['ethnic'];
$modern = $_POST['modern'];
$timeless = $_POST['timeless'];
$styledesc = $_POST['styledesc'];
$wantflowers = $_POST['wantflowers'];
$importance = $_POST['importance'];
$personal = $_POST['personal'];
$cerflowers = $_POST['cerflowers'];
$recflowers = $_POST['recflowers'];
$linens = $_POST['linens'];
$rentals = $_POST['rentals'];
$setup = $_POST['setup'];
$budget = $_POST['budget'];
# This part submits a notification when 
# the form is submitted
// Notification email subject text for copies
$esubject = 'consultation form submission'; 
// Email body text for notifications
$emailtext = "$bride has submitted a consultation request using an email address of $brideemail \n
$bride and $groom are planning a wedding for $date at $time \n
$ceremony at $location1 in $city. \n
The reception will be $reception at $time2 at $location2.\n
$bride can be contacted at $brideemail and $bridephone.  \n
$groom can be contacted at $groomphone. \n
The bride likes $flowerbride flowers and the color $colorbride.  \n
She DISLIKES $flowernotbride flowers and the color $colornotbride. \n
The groom likes $flowergroom flowers and the color $colorgroom. \n
He DISLIKES $flowernotgroom flowers and the color $colornotgroom. \n
Allergies? $allergies  If yes, specify $allergicto \n
The couple enjoys $hobbies.\n
The $maids bridesmaids will be wearing $maidgowns \n
and the $men groomsmen will be wearing $menswear. \n
There will be other bridal party members of $children. \n
The bride gown is $gown. \n
The groom attire is $groomswear.\n
The wedding will be $style.\n
The wedding style can be described as $trendy, $romantic, $traditional, $exotic, $natural, \n
$dreamy, $clean, $classic, $extravagant, $lush, $simple, $soft, \n
$bright, $artistic, $green, $unique, $glamorous, $sophisticated, $earthy, \n
$detailed, $eclectic, $glitzy, $festive, $garden, $westcoast, $boho, \n
$magical, $ethnic, $modern, $timeless \n
and $styledesc. \n
The brides thoughts on the flowers she wants:  $wantflowers \n
She feels that flowers are important to her wedding: $importance \n
She would like us to provide:  $personal, $cerflowers, $recflowers, \n
$linens, $rentals, $setup \n
Her budget is $budget.";
# This function sends the email 
@mail("michellemc5@clearwire.net", $esubject, $emailtext, "From: $brideemail\n");
echo "The consultation form has been submitted.  $bride, we will contact you soon to set an appointment to discuss flowers for your $date wedding.  Thank you!";
exit();
?>
Now I guess I'll tackle the e-mail validation.

Just out of curiosity, does it matter if I validate the e-mail in my php page where the form is (I validate several required fields there) or does it need to be on this page with the script?

Thank you again so much for your help with this script!
Reply With Quote
  #9 (permalink)  
Old Dec 13th, 2007, 14:21
alexgeek's Avatar
Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,771
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: [SOLVED] parse error, unexpected T_EXIT in php mail script

If you mean should you validate with javascript or PHP - definitely PHP.
Javascript an easily be turned off or altered.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Parse error-Need Help! dhossai PHP Forum 6 Dec 17th, 2007 23:21
PHP Mail Submit Form Error longstand PHP Forum 6 Nov 11th, 2007 16:02
What is a Parse Error? rubyfruit Starting Out 1 Jul 5th, 2007 20:40
Parse Error Maverick25r PHP Forum 4 Sep 15th, 2006 16:55
syntax error: unexpected T_BOOLEAN_AND... jswebdev PHP Forum 4 Jan 28th, 2006 07:29


All times are GMT. The time now is 22:34.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43