LinuxQuestions.org
Have you listened to LQ Radio?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Tags used in this thread
Popular LQ Tags , , , , , , , , ,

Reply
 
Thread Tools
Old 08-25-2009, 01:29 AM   #1
hiddenmirageads
LQ Newbie
 
Registered: Aug 2009
Posts: 3
Thanked: 0
Question PHP Parse Error!!


[Log in to get rid of this advertisement]
i am using wampserver with php version 5.3.0 i am getting this error in my php.

Parse error: parse error in C:\wamp\www\contactform.php on line 16


and i cant figure out what is wrong with my scripting.


the code is...

<?php

$to = "hiddenmirageads@gmail.com";
$subject = "New Special Effects";

$body = "New Form Request!
Nickname: ".$_POST['username']."
Email: ".$_POST['Email']."
Description of effect: ".$_POST['Describe']."
Provide Footage: ".$_POST['footage']."
Length of video to edit: ".$_POST['Timeofvideo']."
Price range: ".$_POST['checkbox']."
Time range: ".$_POST['Time']."
Paypal: ".$_POST['Paypal'].""

mail($to,$subject,$body)

?>

line 16 is the mail line. someone please tell me what is going wrong.
windows_vista hiddenmirageads is offline  
Tag This Post , , , , , , , , ,
Reply With Quote
Old 08-25-2009, 01:38 AM   #2
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 219
Thanked: 114
Quote:
Originally Posted by hiddenmirageads View Post
line 16 is the mail line. someone please tell me what is going wrong.
You are missing the semicolon at the end of the line.

You seem to be missing the semicolon at the end of your definition of $body, also . . . and you might want to slash out all of those double quotes that do not denote the beginning or end of strings.

Code:
<?php

$to = "hiddenmirageads@gmail.com";
$subject = "New Special Effects";

$body = "New Form Request!
Nickname: \".$_POST['username'].\"
Email: \".$_POST['Email'].\"
Description of effect: \".$_POST['Describe'].\"
Provide Footage: \".$_POST['footage'].\"
Length of video to edit: \".$_POST['Timeofvideo'].\"
Price range: \".$_POST['checkbox'].\"
Time range: ".$_POST['Time']."
Paypal: \".$_POST['Paypal'].\"";

mail($to,$subject,$body);

?>

Last edited by foodown; 08-25-2009 at 01:42 AM..
linux foodown is offline     Reply With Quote
Thanked by:
Old 08-25-2009, 06:59 AM   #3
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Etch/Lenny/Squeeze
Posts: 2,300
Thanked: 89
You don't need to concatenate strings and array elements:
PHP Code:
"this is " myarray['first'] . " today" 
is valid, but this is easier:
PHP Code:
"this is {myarray['first']} today" 
Foodown is correct about the semicolon, and please use PHP tags around code snippets.

jlinkels
linuxdebian jlinkels is offline     Reply With Quote
Thanked by:

Reply

Bookmarks


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the meaning of "PHP Parse error: parse error, unexpected $ in..." frandalla Programming 23 03-04-2009 01:34 PM
Parse error in PhP swaves Linux - Newbie 4 02-04-2009 06:26 PM
PHP Error Parse error: parse error, unexpected $ in /home/content/S/k/i/SkinCare4U/h CowanServices Programming 2 12-09-2008 09:26 PM
PHP parse error in config.inc.php.in Confusedious Linux - Software 2 11-03-2005 06:08 AM
php parse error wujimon Linux - Software 4 03-26-2003 03:37 PM


All times are GMT -5. The time now is 04:48 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration