Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Parse Error ??

  1. #1
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Parse Error ??

    I am new to this forum and i just need help with this error msg that appears after I click the submit button for filling out a form and sending it to an e-mail. Please help me. Here is the PHP file:

    <?PHP

    $to = "webmaster@intermountaincoach.com"
    $subject = "Results from your Request Info form"
    $headers = "From: Form Mailer"
    $forward = 0; # redirect? 1 : yes || 0 : no
    $location = "contact.php"

    ## set up the time ##

    $date = date ("l, F jS, Y");
    $time = date ("h:i A");

    ## mail the message ##

    $msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";

    if ($_SERVER['REQUEST_METHOD'] == "POST") {
    foreach ($_POST as $key => $value) {
    $msg .= ucfirst ($key) ." : ". $value . "\n";
    }
    }
    else {
    foreach ($_GET as $key => $value) {
    $msg .= ucfirst ($key) ." : ". $value . "\n";
    }
    }

    mail($to, $subject, $msg, $headers);
    if ($forward == 1) {
    header ("Location:$location");
    }
    else {
    echo "Thank you for submitting our form. We will get back to you as soon as possible.";
    }

    ?>


    This is the message that I get when I send a test form:
    Parse error: parse error, unexpected T_VARIABLE in /home/intermou/public_html/mailer.php on line 12

    And here is the form itself:

    <form action="mailer.php" method="post">
    <table width="100%">
    <tr><td>Name:</td><td><input type="text" name="name" /></td></tr>
    <tr><td>E-Mail:</td><td><input type="text" name="email" /></td></tr>
    <tr><td>Phone:</td><td><input type="text" name="phone" /></td></tr>
    <tr><td colspan="2">Comments:</td></tr>
    <tr>
    <td><input type="checkbox" name="reserve" value="yes" />
    Reserve</td>
    <td><input type="checkbox" name="inquire" value="yes" />
    Inquire</td>
    </tr>
    <tr>
    <td valign="top">Vehicle Type: </td>
    <td>
    <select name="vehicle" multiple="multiple">
    <option value="van">Van</option>
    <option value="bus">Bus</option>
    <option value="car">Car</option>
    <option value="suv">SUV</option>
    </select>
    </td>
    </tr>
    <tr><td colspan="2" align="center"><input type="submit" /></td></tr>
    </table>
    </form>

    Thanks in advance to those who can help!!!

  • #2
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Never mind!

    Hey guys nevermind! I got it going!!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •