Jump to content

unexpected T_STRING - Error


phpnewbieca

Recommended Posts

I am receiving the following error:

 

Parse error: syntax error, unexpected T_STRING in /home/xgasq39z/public_html/repair_upgrade.php on line 183

 

I have checked the code several times and I cannot find an error in the function below.

 

           function Repair_Upgrade_2() {
            // email customer
            global  $Send_To, $Date, $confirmation_number, $Eighteen, $List, $List_2, $Dsn, $Title, $Fname, 
            $Lname, $Address, $City, $City_2, $State, $Zip, $Email, $Phone, $Phone_2, $Computerbrand, 
            $Computermodel, $Cd, $Cd_rw, $Cpu, $Dvd, $Dvd_rw, $Graphic_card, $Memory, $Modem, $Monitor, 
            $Multimedia, $Network_card, $Printer, $Scanner, $Sound_card, $Speakers, $Comments;
            // EDIT THE LINE BELOW AS REQUIRED
            // $Send_To = "[email protected]"; 
            // FUNCTION
            function died() {
             // your error code can go here
             echo "These errors appear below.\n";
             echo "<br /><br />\n";
             echo "$error_message\n";
             echo "<br /><br />\n";
             echo "Please go back and fix these errors.\n";
             echo "<br /><br />\n";
             die();
           }
            $error_message = "";
            $email_exp = "^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$";
            if(!eregi($email_exp,$Email)) {
             $error_message.= 'The Email Address you entered does not appear to be valid.<br />';
            }
            $string_exp = "^[a-z .'-]+$";
            if(!eregi($string_exp,$Fname)) {
             $error_message.= 'The First Name you entered does not appear to be valid.<br />';
            }
            if(!eregi($string_exp,$Lname)) {
             $error_message.= 'The Last Name you entered does not appear to be valid.<br />';
            }
            if(strlen($Comments) < 2) {
             $error_message.= 'The Comments you entered do not appear to be valid.<br />';
            }
            $string_exp = "^[0-9 .-]+$";
            if(!eregi($string_exp,$Phone)) {
             $error_message.= 'The Daytime Phone Number you entered does not appear to be valid.<br />';
            }
            if(!eregi($string_exp,$Phone_2)) {
             $error_message.= 'The Evening Phone Number you entered does not appear to be valid.<br />';
            }
            if(strlen($error_message) > 0) {
             died($error_message);
            }
           //FUNCTION
           function clean_string($string) {
            $bad = array("content-type","bcc:","to:","cc:","href");
            return str_replace($bad,"",$string);
           }
    
            $subject = "RE: Repair-Upgrade Order\n\n";
            $email_message = "Hello, $Title $Fname $Lname\n";
            $email_message.= "Thank you for your order.\n";
            $email_message.= "This is what you submitted:\n";	
            $email_message.= "Age Verification: $Eighteen\n";	
            $email_message.= "Type Order: $List\n";
            $email_message.= "Type Service: $List_2\n";
            $email_message.= "Title: $Title\n";
            $email_message.= "First Name: ".clean_string($Fname)."\n";  
            $email_message.= "Last Name: ".clean_string($Lname)."\n";
            $email_message.= "Address: $Address\n";
            $email_message.= "City: $City\n";
            $email_message.= "$City_2\n";
            $email_message.= "State: $State\n";
            $email_message.= "Zip Code: $Zip\n";
            $email_message.= "Email Address: ".clean_string($Email)."\n";
            $email_message.= "Daytime Telephone: ".clean_string($Phone)."\n";
  * 183 $email_message.= "Evening Telephone: ".clean_string($Phone_2)."\n";
            $email_message.= "Computer Brand: $Computerbrand\n";
            $email_message.= "Computer Model: $Computermodel\n";
            $email_message.= "Items to be repaired, replaced, or upgraded.\n";
            $email_message.= "CD: $Cd \t\t\t\t CD RW: $Cd_rw \t\t\t\t CPU: $Cpu\n";
            $email_message.= "DVD: $Dvd \t\t\t\t DVD RW: $Dvd_rw \t\t\t\t Graphic Card: $Graphic_card\n";
            $email_message.= "Memory: $Memory \t\t\t\t Modem: $Modem \t\t\t\t Monitor: $Monitor\n";
            $email_message.= "Multimedia: $Multimedia \t\t\t\t "Network Card: $Network_card \t\t\t\t Printer: $Printer\n";
            $email_message.= "Scanner: $Scanner \t\t\t\t Sound Card: $Sound_card \t\t\t\t Speakers: $Speakers\n";
            $email_message.= "Comments: ".clean_string($Comments)."\n\n";
            $email_message.= "Please VALIDATE your ORDER by clicking the link below.\n";
            $email_message.= "You will need your CONFIRMATION NUMBER $confirmation_number to validate your ORDER.\n\n";
          $email_message.= "<a href=\"www.horace-franklin-jr.com/valid_repair_upgradeform.html\"> Validate Order</a>\n";
           // create email headers
           $headers = "From: ".$Send_To."\r\n".
           "Reply-To: ".$Send_To."\r\n".
           "X-Mailer: PHP/". phpversion();
           $formsent = mail($Email, $subject, $email_message, $headers);
           if ($formsent) {
            echo $formsent;
           } 
           else {
            echo "email was not sent";
            die;
           }  
          }

 

Please tell me what is wrong with this function.

Link to comment
https://forums.phpfreaks.com/topic/182861-unexpected-t_string-error/
Share on other sites

this line

$email_message.= "Multimedia: $Multimedia \t\t\t\t "Network Card: $Network_card \t\t\t\t Printer: $Printer\n";

 

should be

$email_message.= "Multimedia: $Multimedia \t\t\t\t Network Card: $Network_card \t\t\t\t Printer: $Printer\n";

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.