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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:24:09+00:00 2026-05-29T20:24:09+00:00

In my website, user have to upload a file, and should have two buttons

  • 0

In my website, user have to upload a file, and should have two buttons that redirects to either “action1.php” or “action2.php” based on the submit button user clicked.

<form action="action1.php" method="post" enctype="multipart/form-data" />
    <b>Upload a file:<br/>
          <input type="hidden" name="MAX_FILE_SIZE" value="31457"/>
      <input type="file" name="userfile" id="userfile" size="30" />
     <input type="submit" value="GET SEQUENCE" />

</form>

<form action="action2.php" method="post" enctype="multipart/form-data" />
          <input type="hidden" name="MAX_FILE_SIZE" value="3145728"/>
      <input type="file" name="userfile" id="userfile" size="30" />
<input type="submit" value="GET HELIX INFO" />  

Here I have two browse buttons and two actions but the uploaded file is same in both cases. So I want only one browse button and based on what user clicks, it should give either “action1.php” result or “action2.php” result.

  • 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-05-29T20:24:11+00:00Added an answer on May 29, 2026 at 8:24 pm
    <script>
    
    function setAction(form,val,action)
    {
    
    
    form.MAX_FILE_SIZE.value=val;
    form.setAttribute('action',action)
    form.submit();
    
    }
    
    
    </script>
    
    
    
    <form action="action1.php" method="post" enctype="multipart/form-data" />
        <b>Upload a file:<br/>
              <input type="hidden" name="MAX_FILE_SIZE" value="31457"/>
          <input type="file" name="userfile" id="userfile" size="30" />
         <input type="button" value="GET SEQUENCE"  onclick="setAction(this.form,31457,'action1.php')"/>
          <input type="button" value="GET HELIX INFO"  onclick="setAction(this.form,3145728,'action2.php')"/>
    
    
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website that allows a user to upload a spreadsheet of items
I have a website that's using forms authentication and membership. A user must have
I'm about to create a user based website and will have to store photo,
I have a website going that takes a user's uploaded image, and makes three
I have a file upload form on my website and would like to add
I have a website based on GAE and Python, and I'd like the user
I have a web site which handles files management. User can upload file, add
On my website I use simple file management. User can upload files, see the
I have a feature that uploads a user submitted CSV file into my database
I'd like to have an <input type=file> form element that fires the upload process

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.