Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7546483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:12:34+00:00 2026-05-30T09:12:34+00:00

I keep getting a syntax error Parse error: syntax error, unexpected ‘{‘ in contact_form.php

  • 0

I keep getting a syntax error

Parse error: syntax error, unexpected '{' in contact_form.php on line 18

but I cannot seem to be able to find it, heres the code

<?php
require_once('classes/class.phpmailer.php');
include_once("classes/class.smtp.php"); // optional, gets called from within         class.phpmailer.php if not already loaded
include_once("includes/contact_form_constants.php"); 
include('funcs.php');
$errors='';
if((isset($_FILES['file']))&&(($_FILES['file']['error']==2)||($_FILES['file']    ['error']==1))){
echo "The file you tried to upload is too large. Please try again with a smaller file     2";
header('Location: ../result.php?title=Form Submission&msg=3');
}else if(($_FILES['file']['name']!=='')&&($_FILES['file']['error']>2) &&($_FILES['file']    ['error']!==4)){
$msg = 'apperently there has been an error in the contact form from the     electropolishing contact form, should probably get on it<br/>';
$msg.= 'here is some information on the file that the user tried to upload<br />';
$msg.= 'the error that was give was code #'.$_FILES['file']['error'].'<br/>';
$msg.= 'You can find more information about on the codes <a href="http://php.net/manual/en/features.file-upload.errors.php">here.</a><br/>';
$msg.= "<br/> sent on ".date('l jS \of F Y h:i:s A');
$error_email = new PHPMailer(true); // the true param means it will throw     exceptions on errors, which we need to catch
$error_email->IsSMTP(); // telling the class to use SMTP
//this is line 18
try {
//end of line 18
    $error_email->SMTPDebug  = 1;                     // enables SMTP debug information (for testing)
    $error_email->SMTPAuth   = true;                  // enable SMTP authentication
    $error_email->SMTPSecure = "ssl"; 

I have tested this same code in my local enviroment without any problems but the host i’m using is running php 4.4.9, i don’t know if that seems to be the issue

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:12:36+00:00Added an answer on May 30, 2026 at 9:12 am

    PHP 5 has an exception model similar to that of other programming languages.

    (Source)

    PHP 4 does not support try..catch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting the error Parse error: syntax error, unexpected T_STRING on line #9
I keep getting a Parse error: syntax error, unexpected ':', expecting ')' in /home/jobkill/public_html/process.php
I keep getting an error: invaled syntax for 1.add_xpath('tagLine', '//p[@class=tagline]/text()') and I cannot seem
I keep geting this error: Parse error: syntax error, unexpected '}' in /Users/skline/Sites/tiptap/Site/tiptap/survey_current.php on
I keep getting the following error in my log PHP Parse error: syntax error,
here's the error I keep getting: Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ')'
Hey guys! I keep getting a syntax error (unexpected $end), and I've isolated it
I'm making a login script and I keep getting this error Parse error: syntax
I keep getting the Syntax Error: Unexpected identifier JS error with this code: function
Hi i want to run an if statement but keep getting syntax errors near

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.