LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 12: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, 12:38 AM   #2
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 611

Rep: Reputation: 221Reputation: 221Reputation: 221
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 12:42 AM.
 
Old 08-25-2009, 05:59 AM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

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



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 12:34 PM
Parse error in PhP swaves Linux - Newbie 4 02-04-2009 05:26 PM
PHP Error Parse error: parse error, unexpected $ in /home/content/S/k/i/SkinCare4U/h CowanServices Programming 2 12-09-2008 08:26 PM
PHP parse error in config.inc.php.in Confusedious Linux - Software 2 11-03-2005 05:08 AM
php parse error wujimon Linux - Software 4 03-26-2003 02:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:19 AM.

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
Open Source Consulting | Domain Registration