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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:52:41+00:00 2026-06-11T19:52:41+00:00

I have this page which when opened just reads in some session variables and

  • 0

I have this page which when opened just reads in some session variables and assigns them to new variables and then unsets them, I do this so they can’t be carried forward to another page. This all works good.

But, I also have a submit button with a form on the same page. For some reason, when I press the submit button, it is not completing the queries it should and just reuses the session checking code. Which because the session variables are unset, then fails the validation for them.

Why is it re-running this session validation and not running my submit button code/

This is the session validation at the very top of the page, and is the code which for some reason is re-run on submit button click

$ahid="";
    $bid="";
    $np="";
    $nt="";

if (isset($_SESSION['ahid'])) {

          $ahid = $_SESSION['ahid'];
          unset($_SESSION['ahid']);
          if (isset($_SESSION['bid'])) {

                $bid = $_SESSION['bid'];
                unset($_SESSION['bid']);
                if (isset($_SESSION['nt'])) {

                        $nt = $_SESSION['nt'];
                        unset($_SESSION['nt']);
                        if (isset($_SESSION['np'])) {


                            $np = $_SESSION['np'];
                            unset($_SESSION['np']);
                         }else{
                                  header('Location: builders.php?hi=1');
                                  exit();
                              }
                 }else{
                          header('Location: builders.php?hi=2');
                          exit();
                      }
         }else{
                  header('Location: builders.php?hi=3');
                  exit();
              }
     }else{
              header('Location: builders.php?hi=4');
              exit();
          }

This is the submit button code that should be run, but instead is not even touched

if(isset($_POST['build_chk_finish'])){

        $construction_insert = mysql_query("INSERT INTO construction (user_id, estate_id, addon_h_id, builder_id, con_total_price, con_total_time, con_time_started, con_time_ending, con_completed) 
     VALUES('$user_id', '$estate_id', '$ahid', '$bid', '$np', '$nt', now(), '$future_date', '0')", $general)  
     or die (mysql_error());

     $construction_id = mysql_insert_id();

     $con_error="";
     $con_error = "Congratualtions! Your Builder has been hired and has begun work.";
            $_SESSION['error'] = $con_error;
            header("Location: houses.php");

    }

Just for added info, when I press the submit button it is failing on the first session validation builders.php?hi=4.

Here is the submit button

<input name="build_chk_finish" type="submit" class="build_chk_finish" id="bc_submit"/>

  • 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-11T19:52:43+00:00Added an answer on June 11, 2026 at 7:52 pm

    as I understand, this brunch is executed:

    }else{
            header('Location: builders.php?hi=4');
            exit();
    }
    

    When it should not, as I understand. But take a look at if branches. One above will be executed any time when $_SESSION[‘ahid’] is not set. That is because that else is related to if (isset($_SESSION['ahid'])) {:

        if (isset($_SESSION['ahid'])) {
            ....// a lot of other if statements here
        }else{
                header('Location: builders.php?hi=4');
                exit();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this page which has three peson searchs on them. Basically it's a
I have this html page which is very simple, it contains a text box
I have a page which has document.body.onload=function(){...} but this is suffering delays because the
I have one master page which applies to all pages in this website. On
On my main page I have this jquery code which does an ajax call
I have a javascript page which checks an email and username, this works fine
I have a jsp page which needs a java code. This java code inside
I have a select box on a classic ASP page which looks like this:
I'm using ExtJS on a registration page which should have no effect on this.
This may sound a weird question, I have a page which has a link:

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.