Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8748759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:34:53+00:00 2026-06-13T12:34:53+00:00

can you help i’m getting a Parse error: syntax error, unexpected end of file

  • 0

can you help i’m getting a Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\xampp\form-to-email.php on line 42 wondering if you can helpme with this i’m so confused…

<?php    {   
    if(!isset($_POST['submit']))
    {
    //This page should not be accessed directly. Need to submit the form.
    echo "error; you need to submit the form!";

    $name = $_POST['name'];
    $attend = $_POST['attend'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $office = $_POST['office'];
    $starter = $_POST['starter'];
    $mainmeal = $_POST['mainmeal'];
    $specialdietaryrequirements = $_POST['specialdietaryrequirements'];
    $otherdietaryrequirements = $_POST['otherdietaryrequirements'];
    $nameofguest = $_POST['nameofguest'];
    $starterguest = $_POST['starterguest'];
    $mainmealguest = $_POST['mainmealguest'];
    $guestspecialdietaryrequirements = $_POST['guestspecialdietaryrequirements'];
    $guestotherdietaryrequirements = $_POST['guestotherdietaryrequirements'];
    //email body
    $email_from = 'my@email.com';
    $email_subject = "Christmas Part Submission";
    $email_body = "You have received a new message from the user $name.\n".
    "Are you attending: $attend \n".
    "Email address from the person: $email \n".
    "Contact number: $phone \n".
    "Office: $office \n".
    "Starter: $starter \n".
    "Main Meal: $mainmeal \n".
    "Special Dietary Requirements: $specialdietaryrequirements \n".
    "Other Dietary Requirements: $otherdietaryrequirements \n".
    "Name of Guest: $nameofguest \n".
    "Guest Starter: $starterguest \n".
    "Guest Main Meal: $mainmealguest \n".
    "Guest Special Dietary requirements: $guestspecialdietaryrequirements \n".
    "Guest other Dietary requirements: $guestotherdietaryrequirements \n".
    // who it is being sent too (edit this)
    $to = "my@email.com";
    $headers = "From: $email_from \r\n";
    mail($to,$email_subject,$email_body,$headers);
    {   ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:34:54+00:00Added an answer on June 13, 2026 at 12:34 pm

    Replace this:

    <?php    {   
    if(!isset($_POST['submit']))
    {
    

    with

    <?php  
    if(!isset($_POST['submit']))
    {
    

    and the { at the very end of your long code should be }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anybody can help me with this code I am getting this error message: Server
I'm hoping someone can help with this, I'm having a really difficult time getting
Someone can help me write a small ssh script to test if file /usr/modified.txt
Im hoping someone can help me with a small problem! I have a php
Anyone can help to how to handle bitmap exceeds VM buget error. Actually i
anyone can help me implement this Given that i have a txt file and
Anyone can help us here - we have been having this error for several
how can help me getting this main function running, dont know how to do
Anyone can help? Don't know why got error? ??? Assignment has more non-singleton rhs
Anyone can help ? I am having trouble, already unzipped the file I downloaded

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.