Jump to content

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 = "service@horace-franklin-jr.com"; 
            // 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";

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.