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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:25:38+00:00 2026-06-09T06:25:38+00:00

I am designing simple HTML with a drop-down list and a button. I want

  • 0

I am designing simple HTML with a drop-down list and a button.

I want to know how to retrieve the selected drop-down item into php variable. I am writing php-html embed code. I am confused about how to get the particular value in php variable. Also, I would like to know how to download a file after selecting that particular item. I already created downloading file, but I have no idea how to invoke those from selected drop-down item.

Any help will be appreciated.
Thank you.

I am pasting some php-html code which I am trying:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Get All Reports</title>
</head>
<body>
<center>
<div>
<form action="">
<table>
<tr><td>
<select onchange="ReportList(this.form,0)">
<option value="SubscriptionReport.php" >Subscription Report
<option value="DownloadHistoryReport.php">DownloadHistory Report
<option value="AppEventReport.php">AppEvent Report

</select>


</td></tr>
<tr><td>
<button name="isSubmit">Download</button>
</td></tr>
</table>
</form>
</div>
</center>


</body>
</html>
  • 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-09T06:25:39+00:00Added an answer on June 9, 2026 at 6:25 am

    The value of that input will be passed via whatever method you use in your form. The page it is sent to will access the form input value through $_GET or $_POST, whichever method was used.

    <form method="post" action="process.php">
        <input type="text" value="3" name="myInput" id="myInputId" />
    </form>
    

    Would be accessed, in process.php, as such:

    <?php
        $inputValue = $_POST['myInput'];
    

    Notice that the input is passed via its name and not its id attribute.

    For a GET form submission:

    <form method="get" action="process.php">
        <input type="text" value="3" name="myInput" id="myInputId" />
    </form>
    

    Would be accessed, in process.php, as such:

    <?php
        $inputValue = $_GET['myInput'];
    

    Note that when you submit a form via GET, it appends the key/value pair to the querystring:

    http://www.example.com/process.php?myInput=3
    

    If you want to submit your form to the same page on which it exists, just leave the action attribute blank.

    <form method="post" action="">
        <input type="text" value="3" name="myInput" id="myInputId" />
    </form>
    

    NOTE: PHP can only access form variables once they have been submitted. If you want to retrieve the value of a form element, you must use javascript event handlers. PHP is server-side and cannot react to user input until the server receives it. Javascript is client-side. It “sees” what the user does in the browser and can handle those events.

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

Sidebar

Related Questions

I've been designing and coding up my website and the simple drop down menu
I'm designing a very simple web page (HTML only), the only feature I want
Okay, so I'm designing this site. Here's the HTML markup of this simple element:
I am designing a simple registration form in ASP.net MVC 1.0 I want to
i am designing a simple project based to do list. the idea is to
I'm designing an HTML page for display in Android browsers. Consider this simple example
Designing a simple HTML table that I am going to implement alternate-row coloring on...
I'm designing a simple board game in jquery/php. The state of the board is
I am designing a simple Rich Text Editor using HTML/Javascript. It uses iframe. While
I'm currently designing a chat website. The layout will be very simple. I want

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.