Skip to main content
Participant
July 14, 2010
Question

PHP dropdown help

  • July 14, 2010
  • 5 replies
  • 650 views

Hi, I am not a programmer, just trying to fix something on my own website and hoping someone can help.

There is a dropdown menu on my administrator tool for the year.  (Just to explain, I add press credits to my website by Month/Year.  I pick the Month and Year from dropdowns but it was set so that I can't go to years prior and I need to add some 2009 press.)  I think I found the code for this but not sure what to change.  I am pasting it below, to see if it is really a simple fix if someone can advise.  I included the picture of the dropdown from my admin in case its not clear what i'm talking about.

There is tons of other code but when I click on year, the following is highlighted so I assumed that was the related code.

Please use simple instructions as I really have no experience with this!

Thank you!

</select> <select name="year"><?

for($i=date("Y");$i<2030;$i++){

echo '<option value="'.$i.'">'.$i.'</option>';

}

?>

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

David_Powers
Inspiring
July 15, 2010

jeg10011 wrote:

<select name="year"><?

for($i=date("Y");$i<2030;$i++){

echo '<option value="'.$i.'">'.$i.'</option>';

}

?>

Change this line:

for($i=date("Y");$i<2030;$i++){

to this:

for($i=2009;$i<2030;$i++){

Is that explanation simple enough?

jeg10011Author
Participant
July 15, 2010

David, thank you for your quick and easy response.

So, I tried it and while it did change the dropdown to include 2009, something else seems to have gone wrong.  (more like i did something wrong)

This is the admin screen now:

In the dreamweaver php file there is a warning that reads: Dynamically related files cannot be discovered because there is no site definition for this document. (setup link)

Is there a quick fix here or am I over my head?

Thanks!

Jill

David_Powers
Inspiring
July 15, 2010

That error has nothing to do with the change I told you to make.

It's very difficult to read the screenshot you have posted, but the errors are caused by the failure of the script to find a file called dbconfig.php. Looking at the error message, it appears that dbconfig.php is in Collection/painted greece. It looks as though there's a space in the "painted greece" directory (folder) name. Spaces should never be used in file and folder names for a website, particularly if it's hosted on a Linux server, as your site is.