Jump to content

Only show directories that have name of date entered by user PostPosted: Wed Jan


Recommended Posts

Hello! I'm kind of a PHP rookie but I know I have to do something somewhat challenging...I'd be really thankful for any help :)

 

I have a directory that will show a list of directories that will be named by year/month/day/ like this:

2009_05_15

2009_05_16

2009_05_17

2009_05_18

2009_05_19

2009_05_20

 

So theoretically from my website the user will enter in the fields the Year, Month, and day (and maybe hour) that they want so they can download the files that are within that directory(Y/M/D named).

 

So how can I display only the directories from the date the user entered?

 

So far I'm only able to download the files once I'm in the directory :

<?php

if ($dir_handle = opendir(".")) {

while (($curr = readdir($dir_handle)) !== false) {

//!== is not a typo :)

?>

<a href="<?=$curr ?>"><?=$curr ?></a> <br></br> //(<?=$curr ?>) is short for <?php echo $curr; ?>

<?php

} //end while

} //end if

?>

 

Is this do-able? Any help much appreciated!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.