Mohammed Ismail Mohammed Ismail - 8 days ago 6
PHP Question

PHP mail errors

Hi guys here below is my entire code:

<html>
<body>
<?php

$name = $_POST['name'];
$surname = $_POST['surname'];
$email = $_POST['email'];
$message = $_POST['message'];
$support_address = "info@bkslegal";
$headers = "From: ".$email;
$header2 = "From: ".$support_address;
$finalmessage = "
From:$_POST[name]
Email:$_POST[email]
Message:$_POST[message]
";

if ( $name == "")

{
}
else
{
mail ($support_address, $subject, $message, headers);
$result = "Your message has been sent succesfully!"


}
?>




<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="js/superfish.js"></script>
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="js/jquery.tweet.js"></script>
<script type="text/javascript" src="js/jquery.colorbox-min.js"></script>
<script type="text/javascript" src="js/jflickrfeed.min.js"></script>
<script type="text/javascript" src="js/scrolltopcontrol.js"></script>

<script type="text/javascript" src="js/modernizr.custom.44625.js"></script>
<script type="text/javascript" src="js/contact.js"></script>

<script type="text/javascript" src="js/custom.js"></script>

<script type="text/javascript">
jQuery.noConflict()(function($){
$(document).ready(function() {
if(!Modernizr.input.placeholder){
$("input").each(
function(){
if($(this).val()=="" && $(this).attr("placeholder")!=""){
$(this).val($(this).attr("placeholder"));
$(this).focus(function(){
if($(this).val()==$(this).attr("placeholder")) $(this).val("");
});
$(this).blur(function(){
if($(this).val()=="") $(this).val($(this).attr("placeholder"));
});
}
});

$("textarea").each(
function(){
if($(this).val()=="" && $(this).attr("placeholder")!=""){
$(this).val($(this).attr("placeholder"));
$(this).focus(function(){
if($(this).val()==$(this).attr("placeholder")) $(this).val("");
});
$(this).blur(function(){
if($(this).val()=="") $(this).val($(this).attr("placeholder"));
});
}
});

}
});
});
</script>
</body>
</html>


So i get an error saying


"Parse error: syntax error, unexpected '}' in
/home/bkslegal/public_html/send.php on line 28"


and when i remove that curly bracket i get the following error:


"Parse error: syntax error, unexpected end of file in
/home/bkslegal/public_html/send.php on line 83


I have been sitting for hours trying to resolve this, could someone please help

Answer

Your error is here.. You need to add ; at the end of statement $result

 mail ($support_address, $subject, $message, headers);
    $result = "Your message has been sent succesfully!"; 
Comments