freeze mobile Posted January 12, 2009 Share Posted January 12, 2009 Hello, Please I need help with this php code, it keeps returning this message in the browser Parse error: syntax error, unexpected T_STRING in C:\ with a directory in line 21 below is my code <?php $mailto = '[email protected]' ; $subject = "Request Form" ; $formurl = "http://www.fleetderivatives.com/book.html" ; $errorurl = "http://www.fleetderivatives.com/error.html" ; $thankyouurl = "http://www.fleetderivatives.com/complete.html" ; $email_is_required = 1; $name_is_required = 1; $uself = 0; $use_envsender = 0; $use_webmaster_email_for_from = 0; $use_utf8 = 1; $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; $content_type = (!isset( $use_utf8 ) || ($use_utf8 == 0)) ? 'Content-Type: text/plain; charset="iso-8859-1"' : 'Content-Type: text/plain; charset="utf-8"' ; if (!isset( $use_envsender )) { $use_envsender = 0 ; } $envsender = "-f$mailto" ; $name = $_POST['name'] ; $address = $_POST['address'] ; $vehicle = $_POST['vehicle'] ; $delivery address = $_POST['delivery address'] ; $delivery period = $_POST['delivery date'] ; $usage details = $_POST['usage details'] ; $telephone no = $_POST['telephone'] ; $email = $_POST['email'] ; $other necessary details = $_POST['other necessary details'] ; $http_referrer = getenv( "HTTP_REFERER" ); if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; } if (($email_is_required && (empty($email) || !ereg("@", $email))) || ($name_is_required && empty($name))) { header( "Location: $errorurl" ); exit ; } if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) { header( "Location: $errorurl" ); exit ; } if (empty($email)) { $email = $mailto ; } $fromemail = (!isset( $use_webmaster_email_for_from ) || ($use_webmaster_email_for_from == 0)) ? $email : $mailto ; if (get_magic_quotes_gpc()) { $telephone = stripslashes( $telephone ); } $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "Name of sender: $name\n" . "Address: $address\n" . "Type Of Vehicle: $vehicle\n" . "Delivery Address: $delivery address\n" . "Delivery Date & Time: $delivery date\n" . "Usage Details: $usage details\n" . "Telephone: $telephone\n" . "Email: $email\n" . "Other Necessary Details: $other necessary details\n" . "------------------------- REQUESTS -------------------------\n\n" . $usage details . "\n\n------------------------------------------------------------\n" ; $headers = "From: \"$name\" <$fromemail>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chrequest.php 2.13.0" . $headersep . 'MIME-Version: 1.0' . $headersep . $content_type ; if ($use_envsender) { mail($mailto, $subject, $messageproper, $headers, $envsender ); } else { mail($mailto, $subject, $messageproper, $headers ); } header( "Location: $thankyouurl" ); exit ; ?> Link to comment https://forums.phpfreaks.com/topic/140491-parse-error-syntax-error-unexpected-t_string-in-c/ Share on other sites More sharing options...
Mark Baker Posted January 12, 2009 Share Posted January 12, 2009 Don't use spaces in variable names: $delivery_address = $_POST['delivery address'] ; $delivery_period = $_POST['delivery date'] ; $usage_details = $_POST['usage details'] ; $telephone_no = $_POST['telephone'] ; Link to comment https://forums.phpfreaks.com/topic/140491-parse-error-syntax-error-unexpected-t_string-in-c/#findComment-735190 Share on other sites More sharing options...
freeze mobile Posted January 12, 2009 Author Share Posted January 12, 2009 Thank you .. you like my command line... would do just that and get back to you. Link to comment https://forums.phpfreaks.com/topic/140491-parse-error-syntax-error-unexpected-t_string-in-c/#findComment-735246 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.