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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:21:04+00:00 2026-06-06T08:21:04+00:00

I am trying to come up with a method to differentiate between form being

  • 0

I am trying to come up with a method to differentiate between form being submitted by a unique POST value. While in and of itself this is not that complex an issue my circumstances can lead to their being an issue.

while(!isset($_SESSION['user']) || empty($_SESSION['user'])){
    require_once('login_form.php');
}

When a user goes to a page that requires the user to be logged in to view it. If someone lands on one of these pages and is not already logged in I am displaying the login form. The login form’s action is itself, or rather the page being displayed. Now my issue comes when the page being displayed also has a form. I need a method to ensure that the $_POST data from the login form does not make it to the $_POST data from the page’s form. Normally it would not be an issue except when when form inputs share the same name.

I am wanting a way to differentiate between forms using some unique value. I had been thinking about using HTML buttons for submission.

while(!isset($_SESSION['user']) || empty($_SESSION['user'])){
    require_once('login_form.php');
}
if(isset($_POST['PAGE_FORM']) && !empty(PAGE_FORM)){
    unset($_POST);
}

<form name="PAGE_FORM">
    <button valuye="PAGE_FORM">Submit</button>
</form>

I had also thought about doing something like this instead.

while(!isset($_SESSION['user']) || empty($_SESSION['user'])){
    require_once('login_form.php');
    if(isset($_SESSION['user']) && !empty($_SESSION['user'])){
        unset($_POST);
    }
}

<form name="PAGE_FORM">
    <button valuye="PAGE_FORM">Submit</button>
</form>

Let me know what you think. I would be interested in any other ideas you might have.

  • 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-06T08:21:06+00:00Added an answer on June 6, 2026 at 8:21 am

    Instead of including the login_form, do a http redirect to a seperate login form.

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

Sidebar

Related Questions

I am not sure if this is possible but I am trying to come
I'm trying to come up with a method which will measure and return the
I've been trying to come up with a method, that given a day of
I've been trying to come up with an interest point detection algorithm and this
im trying to achieve the following, in php i have a form like this:
I'm trying come up with the best method of synchronizing particular rows of 2
I have come up to issues while I'm trying to write some classes, here
I'm trying come up with a method to determine how long after the user
I'm trying to come up with a method of finding duplicate addresses, based on
I am trying to come up with a method of extracting 4 characters that

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.