Forms

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • squarespiro
    Private First Class

    • Feb 2007
    • 8

    Forms

    I have been over the tutorials a number of times but still can't get my form to work. I am receiving the following message:
    Parse error: syntax error, unexpected '<' in /home/fgmcxow/public_html/action.php on line 178

    Any suggestions?

    here is the php code if that helps

    <?PHP
    $mailto = "chris@squaredeals.co.uk";
    $email = $HTTP_POST_VARS[email];
    if ($email == "") {
    $email = $mailto;
    }
    $mailsubj = "Enquiry_Form";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site form :\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    if ($key!="submit")
    {
    $mailbody .= "$key : $val\n";
    }
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
  • Andy128
    Major General

    • Dec 2005
    • 2317

    #2
    Re: Forms

    YOU are missing the closing php tag- seen here in red.
    <?PHP
    $mailto = "chris@squaredeals.co.uk";
    $email = $HTTP_POST_VARS[email];
    if ($email == "") {
    $email = $mailto;
    }
    $mailsubj = "Enquiry_Form";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site form :\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    if ($key!="submit")
    {
    $mailbody .= "$key : $val\n";
    }
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);

    ?>
    Andy
    PHP- is a blast!

    Comment

    • squarespiro
      Private First Class

      • Feb 2007
      • 8

      #3
      Re: Forms

      Thanks Andy it sorted the problem out straight away.

      Comment

      Working...
      X