Simple Web Post Form Error (Parse error)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JMasterJ
    New Member
    • Aug 2010
    • 2

    Simple Web Post Form Error (Parse error)

    Parse error: syntax error, unexpected T_STRING in /home/pbgwell/public_html/process-form_CC.php on line 16

    Hi all! First post so take it easy on me if i make a mistake. I have done many post forms before, and basically I do it "fool proof" way, save the last one as the new one and edit the data. I am not the PHP expert but I am not totally clueless either, and this has worked until now. I have checked for semicolons and quotes, but the thing is, I dont even have to bec I have tested between two different version on a different domain, and the same part of the error code works in one and doesnt in another. I have also checked my web page form code and thats fine too. Here is the code... (not final version but I deleted a lot of stuff to streamline for testing).. I have use that
    $headers = "From: $email";
    line in all my sites and this is the first time it comes up with an error. I must be missing something else, help!

    _______________ _______________ ____________
    Code:
    <?php
    // Pick up the form data and assign it to variables
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $email = $_POST['email'];
    
    // Build the email (replace the address in the $to section with your own)
    $to = 'jd@ds.com';
    $subject = "PBG.com Service Request from $first $last";
    $body = "New Contact Form Information
    
    First Name: $firstname
    Last Name: $lastname
    Email: $email
    
    $headers = "From: $email";
    
    // Send the mail using PHPs mail() function
    mail($to, $subject, $body, $headers);
    
    // Redirect
    header("Location: form_ty.htm");
    _______________ _______________ ____________
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    check your line 15 in this page. need "; at the end

    Code:
    Email: $email";

    Comment

    • JMasterJ
      New Member
      • Aug 2010
      • 2

      #3
      Gezuuuuuuuz.... I know ZERO basic PHP and ya, I guess thats called closing the body tag? Ya just learned that from more research, and easy to miss when you dont know anything... thanks so much for the straightforward and direct response, just what I needed!

      Comment

      Working...