Jump to content

PHP Parse error: syntax error


m1k3yb0y

Recommended Posts

Hey guys! Since my previous post, I got me some new and better hosting for my website. :hail_freaks: Now I am getting my simple contact form set up on it....and...well, when I submit my contact info, I get a 500 Internal Server error which my browser think it is so it shows its own version of the error. :facepalm:

I looked at my error log and this is what it came up with:

 

"PHP Parse error:  syntax error, unexpected '}' in /var/www/contact0.php on line 662, referer: http://www.mikeytatelive.com/contactform.php"

 

Anybody know how to fix that problem? Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/263779-php-parse-error-syntax-error/
Share on other sites

<title>Contact Mikey Tate - MikeyTateLive.com</title>
<html>
<body bgcolor="333333" text="FFFFFF">
<div id="wrapper">
<div id="pictureWrapper">
  <p align="center">
  <font size="55">Mikey&#8217;s World
  </font>
  </p><br/><br/><br/>
  </div>
    <div id="maincontent">
      <h2>Not quite ready yet!</h2>
      <p>
      $field_name = $_POST['cf_name'];
      $field_email = $_POST['cf_email'];
      $field_message = $_POST['cf_message'];
      $mail_to = '[email protected]';
      $subject = 'New Message from ' . $field_name;
      $body_message = 'The following person, '.$field_name."has sent you a message via your contact form on MikeyTateLive.com. \n";
      $body_message .= 'The message reads: '"\n".$field_message."\n";
      $body_message .= 'Here is the sender&#8217;s email address in case if you would like to reply to him/her: '.$field_message;
      $headers = "From: $cf_email\r\n";
      $headers .= "Reply-To: $cf_email\r\n";
      $mail_status = mail($mail_to, $subject, $body_message, $headers);
      if ($mail_status) { ?>
    <script language="javascript" type="text/javascript">
        // Print a message
        alert('Your message has been sent. Thank you! I will contact you soon.');
        // Redirect to some page of the site. You can also specify full URL, e.g. http://template-help.com
        window.location = 'http://www.mikeytatelive.com/';
    </script>
<?php
} //this is where the error comes from
else { ?>
    <script language="javascript" type="text/javascript">
        // Print a message
        alert('I am sorry. Your message could not be sent. Please try again.');
        // Redirect to some page of the site. You can also specify full URL, e.g. http://template-help.com
        window.location = 'http://www.mikeytatelive.com/';
    </script>
<?php
}?>
    </p>
    </div>
    <div id="footer">
    <p align="Center">©<?php echo date('Y');?> MikeyTateLive Productions Inc.<br/>
    <?php echo date('D, F d, Y - h:i:sa');?><br/>
    Timezone is UTC-1 Greenwich Time</p>
    </div>
</div>
</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.