Results 1 to 3 of 3

Thread: Forms
      
   

  1. #1
    squarespiro is offline Private First Class
    Join Date
    Feb 2007
    Posts
    8

    Question 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);

  2. #2
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default 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!

  3. #3
    squarespiro is offline Private First Class
    Join Date
    Feb 2007
    Posts
    8

    Wink Re: Forms

    Thanks Andy it sorted the problem out straight away.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49