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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:45:14+00:00 2026-06-09T21:45:14+00:00

Currently, I am having one page that display query options and does the form

  • 0

Currently, I am having one page that display query options and does the form validation and another page that process the query and shows the result if validation is successful. I am trying to combine these two pages together such that the user would not need to go back and forth the two pages every time to make some query changes.

The structure of the two page process is as follows:

**Validation Page**
if (post detected)
{
 validate input
 if (no error)
 {
  record query options
  redirect to results page
  exit
 }
 else
 {
  output error message
 }
}
display form

**Results Page**
if (query options are set)
{
 process query
 display results
}
else
{
 redirect to validation page
}

I have seen the concept being implemented simply in search engine pages where the search box and the results are in one page. I am looking to implement something like that using the POST method with a form containing both select and input boxes.

  • 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-09T21:45:15+00:00Added an answer on June 9, 2026 at 9:45 pm

    You can just set the form action to itself (or leave it blank along the lines of action = "" and it will point to itself anyhow, then use a simple check to see whether any form data has been submitted to determine if you should show the empty page or the search results:

    if(isset($_REQUEST['searchStuffs']) // Not sure if you are GET or POST'ing
    {
        if(!empty($_REQUEST['searchStuffs'])
        {
            // do stuff here to get the form result, then display it
        }
        else
        {
            // The form was submitted empty, so show an error
        }
    }
    else
    {
        // Display the normal search/form page as it hasn't been sent.
    }
    

    You can also use the following approach (which I would probably use though it is some extra work):

    $searchBool=false;
    if(isset($_REQUEST['searchStuffs']) // Not sure if you are GET or POST'ing
    {
        if(!empty($_REQUEST['searchStuffs'])
        {
            if(...)// valid search criteria
            {
                $searchBool=true;
                // Do stuff to get search results
                $searchResults='some output or data';
            }
        }
    }
    
    // Echo normal input form
    if($searchBool)
    {
        echo $searchResults;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently having trouble with a live wallpaper that does some very intensive
I am currently creating a one page website, however I am having an issue,
I'm currently having a problem with some Socket stuff. The output that I want
i had use Ajax using jquery. Now i had one page and in that
I'm working on a multi-page form. Here's the outline of its function: Part One:
I've got a html page which loads another html page into one of its
I currently have a page that allows a user to enter different types of
I currently have a PrintingWebService that I call from an AJAX page with all
I currently have a page that generates a table from an SQL database using
In my current company, we have one tester. Having spoken to this tester, she

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.