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

The Archive Base Latest Questions

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

I am trying to create a single dynamic webpage with two separate forms: Sign

  • 0

I am trying to create a single dynamic webpage with two separate forms:

  1. Sign in form
  2. Registration form.

This would mean one submit button for each form and clicking on one submit button should collect data from one form only. I tried the approach shown below but the data was not submitted to mySql database. I have tried running the forms individually and they do work with mysql database so I guess there should be something else wrong. The code below is stripped of details but I reckon the gist of it is inside. Thanks in advance!

<?php
if(isset($_POST['submit1']))
{ 
doSomething(); 
} 
?>

<form id="form1" name="form1" action="" method="post">
...
<input type="submit" name="submit1" value="Sign in"/>
</form>


<?php
if(isset($_POST['submit2']))
{ 
doSomethngElse(); 
}
?>

<form id="form2" name="form2" action="" method="post">
...
<input type="submit" name="submit2" value="Sign up"/>
</form>
  • 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-09T20:45:35+00:00Added an answer on June 9, 2026 at 8:45 pm

    So I do like this:

    Use 2 button with 1 name :

        //========== first form ==========
        <form name="form1" action....>
    
        fields
    
        <input type="submit" name="_Submit" value="Login">
        </form>
    
        // ========== second form ==========
    
        <form name="form2" action....>
    
        fields
    
        <input type="submit" name="_Submit" value="Sign up">
        </form>
    
    
        // ========== in php file do this  ==========
    
        <?php
        $submit = $_POST["_Submit"];
    
        if($submit=="Login"){
    
           // get login form data
    
    
        }else if($submit=="Sign up"){
           // get sign up form data
        }else{
          // submit is empty or undefined value
        }
        ?>
    
    • I use this for more than 16 form in one page! this is very easy way to control forms buttons using if or switch!
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a single page form to create a 'work item'. One
I am trying to create buttons that play single sound files and one button
I am trying to create a single sign on process. The method I have
I'm trying to create a single query that will combine the following two queries.
I am trying to create a single page webapp. There are two divs, right
I'm trying to create a single, one-off page that will combine information from several
I am trying to create a form that takes only a single letter and
I am trying to create a two view, single controller application as follows: I
So I am trying to create a dynamic form where the 2nd dropdown box
I am trying to create a table with a single column using the following

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.