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 6323389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:30:27+00:00 2026-05-24T16:30:27+00:00

Not sure if this is even possible, but the basic idea of the code

  • 0

Not sure if this is even possible, but the basic idea of the code is as follows:

if(isset($_POST['submit'])) {
    if($_POST['field'] == 0) {
        // do not process the code in the if statement
    }
    // code to process if the above validation criteria is not met
}

I basically want to try and keep it as simple as possible without lots of if’s everywhere, just the quick validation statements at the top, and if none of those if statements are triggered, it will process the code to update the database etc.

I have tried the continue statement function with no joy, I believe that only works with loops.

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-05-24T16:30:28+00:00Added an answer on May 24, 2026 at 4:30 pm

    You could put all of this in a function and then call ‘return’ from the inside ‘if’:

    if(isset($_POST['submit']) && validate_form())
    {
        ...
    }
    
    function validate_form()
    {
        if($_POST['field'] == 0) {
            return false;
        }
        if(another check that fails) {
            return false;
        }
        ...
        return true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not sure if this is even possible but here goes: Currently I have
I'm not sure if this is even possible, but here goes: I have a
I'm not even sure if this is even possible, but I've just started WPF
I'm not sure if this is even possible. But I was wondering if anyone
I'm not sure this is even possible, but let's see if one of you
I'm not sure if this is even possible, but I am trying to do
This may be a basic question, and I'm not even sure if it's possible,
I'm not entirely sure if this is even possible, but I'll try my best
I'm not sure if this is even possible on the iphone. Scenario 1 :
I am not sure this is even possible to be honest, I am wondering

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.