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

  • SEARCH
  • Home
  • 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 6841483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:58:21+00:00 2026-05-26T23:58:21+00:00

Not sure whats wrong here the error report says line 9, but when I

  • 0

Not sure whats wrong here the error report says line 9, but when I look the code does not match.

The Error Message :
Parse error: syntax error, unexpected T_STRING, expecting ‘{‘ in /home/hletf/public_html/mailform.php on line 9

Forgive the Tables Please.

HTML FORM CODE :

    <form id="form1" name="form1" method="post" action="mailform.php">

   <table width="90%" border="0" cellspacing="2" cellpadding="2">
     <tr>
       <td width="48%"><div align="right"><h3>Name:</h3></div></td>
       <td width="52%"><input type="text" name="NAME" id="NAME" /></td>
     </tr>
     <tr>
       <td><div align="right"><h3>Email:</h3></div></td>
       <td><input type="text" name="EMAIL" id="EMAIL" /></td>
     </tr>
     <tr>
       <td><div align="right"><h3>Comment:</h3></div></td>
       <td><textarea name="COMMENT" id="COMMENT" cols="45" rows="5"></textarea></td>
     </tr>
     <tr>
       <td><div align="right"></div></td>
       <td>
       <input type="image" name="SUBMIT" id="SUBMIT" src="images/submit_button.jpg" width="81" height="23" />
       </td>
     </tr>
   </table>
             </form>

MAILFORM.PHP :

<?PHP

define('kOptional', true);
define('kMandatory', false);

error_reporting(E_ERROR | E_WARNING | E_PARSE);
ini_set('track_errors', true);

function DoStripSlashes($fieldValue)  { 
// temporary fix for PHP6 compatibility - magic quotes deprecated in PHP6
 if ( function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() ) { 
  if (is_array($fieldValue) ) { 
   return array_map('DoStripSlashes', $fieldValue); 
  } else { 
   return trim(stripslashes($fieldValue)); 
  } 
 } else { 
  return $fieldValue; 
 } 
}

function FilterCChars($theString) {
 return preg_replace('/[\x00-\x1F]/', '', $theString);
}

function CheckEmail($email, $optional) {
 if ( (strlen($email) == 0) && ($optional === kOptional) ) {
  return true;
 } elseif ( eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email) ) {
  return true;
 } else {
  return false;
 }
}



if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
 $clientIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
 $clientIP = $_SERVER['REMOTE_ADDR'];
}

$FTGNAME = DoStripSlashes( $_POST['NAME'] );
$FTGEMAIL = DoStripSlashes( $_POST['EMAIL'] );
$FTGCOMMENT = DoStripSlashes( $_POST['COMMENT'] );
$FTGSUBMIT = DoStripSlashes( $_POST['SUBMIT'] );



$validationFailed = false;

# Fields Validations


if (!CheckEmail($FTGEMAIL, kMandatory)) { $validationFailed = true; }



# Redirect user to the error page

if ($validationFailed === true) {

 header("Location: http://www.glustik.com/error.html");

}

if ( $validationFailed === false ) {

 # Email to Form Owner
  
 $emailSubject = FilterCChars("OMG - Test");
  
 $emailBody = "NAME : $FTGNAME\n"
  . "EMAIL : $FTGEMAIL\n"
  . "COMMENT : $FTGCOMMENT\n"
  . "SUBMIT : $FTGSUBMIT\n"
  . "";
  $emailTo = 'James <james@glustik.com>';
   
  $emailFrom = FilterCChars("$FTGEMAIL");
   
  $emailHeader = "From: $emailFrom\n"
   . "MIME-Version: 1.0\n"
   . "Content-type: text/plain; charset=\"UTF-8\"\n"
   . "Content-transfer-encoding: 8bit\n";
   
  mail($emailTo, $emailSubject, $emailBody, $emailHeader);
  
  
  # Redirect user to success page

header("Location: http://www.glustik.com/thanks.html");

}

?>
  • 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-26T23:58:21+00:00Added an answer on May 26, 2026 at 11:58 pm

    Change your function with this one :

    function DoStripSlashes($fieldValue){
        // temporary fix for PHP6 compatibility - magic quotes deprecated in PHP6
        if ( function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() ) { 
            if (is_array($fieldValue) ) { 
                return array_map('DoStripSlashes', $fieldValue); 
            } else { 
                return trim(stripslashes($fieldValue)); 
            } 
        } else { 
            return $fieldValue; 
        } 
    }   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this error message and I'm not quite sure whats wrong: Exception in
I'm not sure what I'm doing wrong here, but I have a synatx error
Not sure what is wrong with this code. I keep getting the following error:
Not sure what I'm doing wrong here, but say I have: foo.h class foo
I am not sure what I am doing wrong here, but I am having
I know this probably really simple but Im not sure what im doing wrong...
I'm not sure what I am doing wrong, but the text for my JPanels
I'm trying to free g_strdup but I'm not sure what I'm doing wrong. Using
Not sure what exactly is going on here, but seems like in .NET 1.1
ok not sure what i'm doing wrong here: $(#list).jqGrid({ url: --URL--, datatype: 'json', mtype:

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.