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

  • SEARCH
  • Home
  • 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 8113991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:00:46+00:00 2026-06-06T03:00:46+00:00

I have added a checker to ensure that all fields in a form have

  • 0

I have added a checker to ensure that all fields in a form have data within when the form is submitted.

if(     (   isset($_POST['name'] == "Contact")  )
    && (    isset($_POST['company'] == "Company Name")  )
    && (    isset($_POST['address'] == "Address")   )
    && (    isset($_POST['turnover'] == "Approx. Turnover") )
    && (    isset($_POST['employees'] == "No. Of Employees")    ) 
    && (    isset($_POST['contact'] == "Contact Number")    )  
  )
    {
    //nothing has changed and we fail the form
    $_SESSION['failed'] == true;
}
else{

I am getting the following error:

Parse error: syntax error, unexpected T_IS_EQUAL, expecting ‘,’ or ‘)’

Can anyone see what the problem is?
Also, will this check that all post values have data within?

Thanks.

  • 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-06T03:00:48+00:00Added an answer on June 6, 2026 at 3:00 am
    if(isset($_POST['name']) == "Contact") 
    

    should be

    if(isset($_POST['name']) && $_POST['name'] == "Contact") 
    

    (or you can use || if you want OR)

    Also, it does not check if it has a value. It only checks if a variable is set.
    Use either == '' or empty() to check if it’s got a value.

    And

    $_SESSION['failed'] == true;
    

    should be

    $_SESSION['failed'] = true;
    

    == is for comparison and = is for assignment

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

Sidebar

Related Questions

I'm creating a form that has two checkboxes yes and no. I have added
I have added an extra field Specification in Catalog->Product->Data tab. This text is stored
I have added a class to all of the td's associated with my table.
I've (apparently) checked-in (added) a file that shouldn't have been added to a branch.
I have many content type that I have added in drupal 7 and I
I am doing a task related to telerik grid. In that I have added
I have mvc application (tutorial) running OK on SQL Server Express: <add name=MusicStoreEntities connectionString=data
In one of my websites, I have added a reference to IBM.DATA.DB2.dll (which is
I have added a navigation controller inside a viewcontroller thats inside another navigation controller...
I have added a plugin called scrollpaper to a site I'm working on. The

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.