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
I have two pages that inherit from one master page, First.aspx or second.aspx. Navigation
I have two pages, one that edits user information, and one that edits information
I have two select boxes (one for Car Types and the other for Car
I have two pages one is step1.jsp, here the user can input its Function,
I have two pages. First one we open with $_POST variables in its url,
I'm trying to build a portal in which i have two pages , one
I have two forms on one page and want to have the input boxes
I have multiple Facebook like boxes in one page. Suppose, I have two dives
I have two text boxes (select) which I want to change the contents of

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.