...

View Full Version : Parse error: syntax error, unexpected '}'



DiarYofaMadmaN
09-24-2004, 07:26 AM
code in the functions.php file:
<?
//functions page
function send_mail() {
$my_name = $_POST['first_name'].' '.$_POST['last_name'];
$my_email = $_POST['email'];
$to_name = '......';
$to_email = '......';
$subject = '.....!';
$message = '.....';
ThisHTML;
$mailheaders = "From: $my_name <$my_email>\n";
$mailheaders .= "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-Type: text/html; charset=iso-8859-1";
if (!=mail('$to_name <$to_email>', '$subject', '$message', '$mailheaders')) {
echo "mail couldn't be sent";
}
}
?>


<?php
include ('functions.php');
if ($_POST["QuoteCheck"] == "1") {
send_mail()
} //<---15th line
?>

I'm getting this error: Parse error: syntax error, unexpected '}' in c:\Inetpub\wwwroot\clients\butterfly\index.php on line 15

I have the if statement closed off.. i don't understand why i'm getting that error.... thanks for the help...

-peace

dniwebdesign
09-24-2004, 07:44 AM
I don't know if this is the problem but it helps clean it up and acutally sends teh e-mail.



<?
//functions page
function send_mail() {
$my_name = $_POST['first_name'].' '.$_POST['last_name'];
$my_email = $_POST['email'];
$to_name = '......';
$to_email = '......';
$subject = '.....!';
$message = '.....';
ThisHTML;
$mailheaders = "From: $my_name <$my_email>\r\n";
$mailheaders .= "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-Type: text/html; charset=iso-8859-1";
$mail=mail('$to_name <$to_email>', '$subject', '$message', '$mailheaders')

if (!$mail) {
echo "mail couldn't be sent";
}
else
{
echo "Mail Sent";
}
}
?>


<edited: added } as I was missing it>

DiarYofaMadmaN
09-24-2004, 07:51 AM
Thanks for helping me clean up that section of coding.. I'm still getting that parse error though... Can anyone else give me a hand?

-peace

marek_mar
09-24-2004, 08:09 AM
You are missing a ";" in the line above.

Nightfire
09-24-2004, 12:39 PM
This is the 'line above'

$mail=mail('$to_name <$to_email>', '$subject', '$message', '$mailheaders');

You do also realise that the email won't be sent, dont you? Variables inside single quotes ( ' ) don't get parsed. You need to use double quotes ( " )

$mail=mail("$to_name <$to_email>", "$subject", "$message", "$mailheaders");

dniwebdesign
09-24-2004, 05:18 PM
<?
//functions page
function send_mail()
{
$my_name = $_POST['first_name'].' '.$_POST['last_name'];
$my_email = $_POST['email'];
$to_name = '......';
$to_email = '......';
$subject = '.....!';
$message = '.....';
ThisHTML;
$mailheaders = "From: $my_name <$my_email>\r\n";
$mailheaders .= "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-Type: text/html; charset=iso-8859-1";
$mail=mail("$to_name <$to_email>", "$subject", "$message", "$mailheaders");
if (!$mail)
{
echo "mail couldn't be sent";
}
else
{
echo "Mail Sent";
}
}
?>



<?php
include ('functions.php');
if ($_POST["QuoteCheck"] == "1")
{
send_mail() ;
} //<---15th line
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum