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

    Joined:
    Oct 20, 2006
    Messages:
    18
    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"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <?php
    session_start();
    // store session data
    $_SESSION['views']=1;
    ?>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title> Form Submission File </title>
    </head>
    <body>
    <?php require("class.phpmailer.php");
    $mail = new PHPMailer();
    $mail->IsSMTP();
    $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->AddAddress($_SESSION["email"]);
    $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;
    if(!$mail->Send())
    {
    echo "<p>Message was not sent<br />
    Mailer Error; " . $mail->Error Info . "</p>";
    }
    else
    {
    ?>
    <h1>Form Submission </h1>
    <h3>Your information was submitted successfully.</h3>
    <p>One of our customer agents will contact you shortly.</p>
    <? session_destroy(); ?>
    </body>
    </html>


    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!

Loading...
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