1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

php syntax error

Discussion in 'All Other Software' started by bikerdon, May 22, 2008.

Thread Status:
Not open for further replies.
  1. bikerdon

    bikerdon Thread Starter

    Oct 20, 2006
    The following is some php code that I have in a form submission program. When I run this:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    // store session data
    <html xmlns="http://www.w3.org/1999/xhtml">
    <title> Form Submission File </title>
    <?php require("class.phpmailer.php");
    $mail = new PHPMailer();
    $mail->Host = "sendmail.brinkster.com";// SMTP server
    $mail->SMTPAuth = true;
    $mail->Username = "daveburnett";
    $mail->Password = "password";
    $mail->From = "#from";
    $mail->FromName = "Admin";
    $mail->AddAddress("[email protected]", "Don R. Burt");
    $mail->Subject = "Form Submission";
    $body = "<h3>You submitted the following information</h3>
    <p><strong>Name:</strong> ".$_Session["name"]. "<br />
    <strong>EMail Address:</strong> ".$_Session["email"]. "<br />
    <strong>Phone Number:</strong> ".$_Session["phone"]. "<br />
    <strong>Company:</strong> ".$_Session["company"]. "<br />
    <strong>Address:</strong> ".$_Session["address"]. "<br />
    <strong>City, State, &amp;ZIP:</strong> ".$_Session["city"]. "<br />
    <strong>Company:</strong> ".$_Session["company"]. "<br />

    if (isset($_SESSION['selection']) || empty($_SESSION['selection'])) {
    $body .= "";
    } else {
    $body .= "<p><strong>Interests:</strong><br />";
    foreach($_SESSION['selection'] as $key => $value)
    $body .= $key . "<br />";
    $body .= "</p>";

    if(isset($_SESSION['selection1']) || empty($_SESSION['selection1'])) {
    $body .= "";
    } else {
    $body .= "<p><strong>Contact Preference:</strong><br />";
    foreach($_SESSION['selection1'] as $key => $value)
    $body .= $key . "<br />";
    $body .= "</p>";
    $body .= "<p><strong>Comments:</strong> " . $_SESSION["comments"] ."<br />
    Thank you for your feedback!</p>";
    $mail->Body = $body;
    echo "<p>Message was not sent<br />
    Mailer Error; " . $mail->Error Info . "</p>";
    <h1>Form Submission </h1>
    <h3>Your information was submitted successfully.</h3>
    <p>One of our customer agents will contact you shortly.</p>
    <? session_destroy(); ?>

    I get the error message:

    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Sites\Single45\daveburnett\webroot\mail_it.php on line 35

    Can anyone tell me how to correct this? Thanks for your help.
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/714490

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice