LinuxQuestions.org
Review your favorite Linux distribution.
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



Reply
 
Search this Thread
Old 08-25-2009, 01:29 AM   #1
hiddenmirageads
LQ Newbie
 
Registered: Aug 2009
Posts: 3

Rep: Reputation: 0
Question PHP Parse Error!!


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.
 
Old 08-25-2009, 01:38 AM   #2
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 609

Rep: Reputation: 218Reputation: 218Reputation: 218
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.
 
Old 08-25-2009, 06:59 AM   #3
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
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
 
  


Reply

Tags
error, line, parse, php, server


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 09:44 PM.

Main Menu
Advertisement
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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration