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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:10:32+00:00 2026-05-20T15:10:32+00:00

I have two pages. One with the select boxes on and the send button.

  • 0

I have two pages. One with the select boxes on and the send button. When the user chooses their options from the select boxes and clicks send it takes them to the second page which outputs their choices.

date_change.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />

</head>

<body>
<?php
$day = array(range(1,31));
$month = array(range(1,12));
$year = array(range(2011,2020));
?>
<form action="test.php" method="post">
Day:
<select >
  <?php foreach($day[0]++ as $key => $value) { ?>
    <option value="<?php echo $key ?>" name="day"><?php echo $value ?></option>
  <?php }?>
</select>
<br>
Month:
<select>
  <?php foreach($month[0]++ as $key => $value) { ?>
    <option value="<?php echo $key ?>" name="month"><?php echo $value ?></option>
  <?php }?>
</select>
<br>
Year:
<select>
  <?php foreach($year[0]++ as $key => $value) { ?>
    <option value="<?php echo $key ?>" name="year"><?php echo $value ?></option>
  <?php }?>
</select>
<input type='submit' value='send' name='send' />
</form>


</body>
</html>

Once the user makes their choices and clicks send it takes them to test.php:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />

</head>

<body>

Date Selected: <?php echo $_POST["day"];echo $_POST["month"];echo $_POST["year"]; ?>

</body>
</html>

However, even though it goes to the test.php page it doesnt show what the user picked. Any help?

where am I going wrong?

  • 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-20T15:10:33+00:00Added an answer on May 20, 2026 at 3:10 pm

    You should add a name attribute to your <select> tags instead of your <option> tags.

    Also, you should change <br> to <br /> for XHTML valid code.

    Change you code to:

    Day:
    <select name="day">
      <?php foreach($day[0]++ as $key => $value) { ?>
        <option value="<?php echo $key; ?>"><?php echo $value; ?></option>
      <?php } ?>
    </select>
    <br />
    Month:
    <select name="month">
      <?php foreach($month[0]++ as $key => $value) { ?>
        <option value="<?php echo $key; ?>"><?php echo $value; ?></option>
      <?php } ?>
    </select>
    <br />
    Year:
    <select name="year">
      <?php foreach($year[0]++ as $key => $value) { ?>
        <option value="<?php echo $key; ?>"><?php echo $value; ?></option>
      <?php } ?>
    </select>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have I have two pages. One with the select boxes on and the
We have some web pages which have two frames, with one frame in the
For simplicity lets say I have two flex mxml pages. form.mxml button.mxml If the
I have two forms on a page (one is being grabbed by AJAX). I
I have a page with two ContentPlaceHolders. One has a DropDown and another UpdatePanel
I have two pages of jQuery, Page1 and Page2, and I'm able to get
Ok, i have simple scenario: have two pages: login and welcome pages. im using
I have two html pages, when you click on something on the first html,
Here is the scenario: I have two asp pages. a.aspx is layout and b.aspx
I have modified this example from the SDK pages to grab all the Contact

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.