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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:55:17+00:00 2026-06-18T04:55:17+00:00

I did the php code with two buttons in 1st php file .Now i

  • 0

I did the php code with two buttons in 1st php file.Now i am trying to do in another php file, by clicking the button one seperate form is to be open and by clicking the other button another seperate form is to get open. But i dont know how to do this.

<input type="submit" name="question" value="question" />
<input type="submit" name="answer" value="answer" />

please tell me how to do this.

  • 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-18T04:55:18+00:00Added an answer on June 18, 2026 at 4:55 am

    Method 1

    <input type="submit" name="question" value="question" onclick="file1.php" />
    <input type="submit" name="answer" value="answer"  onclick="file2.php" />
    

    Method 2

    <form action="file1.php" method="post">
    <input type="submit" name="question" value="question" /></form>
    
    <form action="file2.php" method="post">
    <input type="submit" name="answer" value="answer" /></form>
    

    If your using a single file then keep a hidden variable on form and check the variable value on the next page and take nessery action.
    ex:

        <form action="a.php" method="post">
    <input type="hidden" name="Var1" value="question"/> 
        <input type="submit" name="question" value="question" />
    </form>
    
        <form action="a.php" method="post">
    <input type="hidden" name="Var1" value="answer"/> 
        <input type="submit" name="answer" value="answer" /></form>
    

    a.php

    check POST['var1']=="question"{
    //do something
    }
    check POST['var1']=="answer"{
    //do something
    }
    

    I dont know if there is any bettr method, but you can solve like this

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

Sidebar

Related Questions

I am trying to compare two PHP projects using PHP Depend (http://pdepend.org). One is
I am trying to learn more about the PHP function sprintf() but php.net did
Unable to upload photo. PHP gives error You did not select a file to
I'm trying to change my approach in writing javascript as I did with PHP.
I need to have two files. Let's call the file controlling a second one:
Basically I've created two php papes. One selects my entire table, and displays just
I did a small web application for using PHP, HTML, and JavaScript. I want
I am writing a daemon in PHP. I did not take a OS class
I'm tryning to install apache and php on centos, I did install this: yum
I've been thinking about creating a forum in PHP so I did a little

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.