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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:25:31+00:00 2026-06-07T21:25:31+00:00

Here is my code for my drop down menu. On one server, the appropriate

  • 0

Here is my code for my drop down menu. On one server, the appropriate numbers are shown. But on another, I am seeing “>” for each choice in the drop down menu. I’m guessing this has something to do with the php.ini file, but I’m not sure…

<?php
// connect to the database
require 'connect.php';

// -------------------------------------------------------------------------------------------------------
// Drop Down Menu to choose Start and End dates
$startyear = ""; 
$startmonth = "";
$startday = "";
$endyear = "";
$endmonth = "";
$endday = "";

// Array of values for form
$year  = range(1998,2012);
$month = range(01,12);
$day   = range(01,31);

if($_SERVER['REQUEST_METHOD']=='POST')
{
    foreach($_POST as $key=>$value)
    {
        if(is_numeric($value))
        {
            $$key = $value;
        }
    }
}

?>

<form name='update' action='' method='POST'>
Start: <select name='startyear'>
    <?php foreach(array_reverse($year) as $y):?>
    <option value="<?=$y?>"<?=((isset($startyear) && $startyear == $y)?' selected':null)?>><?=$y?></option>
    <?php endforeach;?>
</select>
<select name='startmonth'>
    <?php foreach($month as $m): $m = str_pad($m, 2, "0", STR_PAD_LEFT);?>
    <option value="<?=$m;?>"<?=((isset($startmonth) && $startmonth == $m)?' selected':null)?>><?=$m;?></option>
    <?php endforeach;?>
</select>
    <select name='startday'>
    <?php foreach($day as $d): $d = str_pad($d, 2, "0", STR_PAD_LEFT);?>
    <option value="<?=$d;?>"<?=((isset($startday) && $startday == $d)?' selected':null)?>><?=$d;?></option>
    <?php endforeach;?>
</select>
<br>
End: <select name='endyear'>
    <?php foreach(array_reverse($year) as $y):?>
    <option value="<?=$y?>"<?=((isset($endyear) && $endyear == $y)?' selected':null)?>><?=$y?></option>
    <?php endforeach;?>
</select>
<select name='endmonth'>
    <?php foreach($month as $m): $m = str_pad($m, 2, "0", STR_PAD_LEFT);?>
    <option value="<?=$m;?>"<?=((isset($endmonth) && $endmonth == $m)?' selected':null)?>><?=$m;?></option>
    <?php endforeach;?>
</select>
    <select name='endday'>
    <?php foreach($day as $d): $d = str_pad($d, 2, "0", STR_PAD_LEFT);?>
    <option value="<?=$d;?>"<?=((isset($endday) && $endday == $d)?' selected':null)?>><?=$d;?></option>
    <?php endforeach;?>
</select>
<input type='submit' value='View'/>
</form>
  • 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-07T21:25:33+00:00Added an answer on June 7, 2026 at 9:25 pm

    Try swapping the short PHP tags for the long ones.

    <?= becomes <?php echo
    And
    <? becomes <?php

    Some configurations let you use the short forms; all PHP configurations let you use the longer ones.

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

Sidebar

Related Questions

i have two dropdown list. first drop down:1 enter code here <form:select path=custName id=custName>
I'm trying to create a drop down menu, where only ONE drop down is
I'm trying to build a horizontal drop down menu with CSS. But the submenu
I've used this bit of code to get a drop-down style menu on a
I've put together a piece of code for a drop-down menu, bound to .hover()
I'm making a pure css dropdown menu (code here: http://jsfiddle.net/SeXyv/7/ ) and I would
I am trying to build a drop-down menu that will show a row to
I am really confused. I want to create a Select drop down menu using
At my sandbox site , if you load it a drop down menu appears
I have a link that functions similar to a drop down menu in that

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.