|
||||||
| PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||||
|
Okay well i have a new upload site i been working on for a few days. Has my login/register system and my upload system. When you register it makes you, your own folder chmod to 755 and the folder has the name you registered with on it. So when you upload it uploads to your folder.
So here is an example. Index of /whitey That shows your uploads in your folder. Well i am going to make a PHP script in the folder that shows all the users images.. (limits 20 per page) but the thing is how to make it show all the images in the folder.. Decending by date.. If you could help me start this that would be great.. |
| Sponsored Links |
|
|
|
|||||
|
I do not believe the file has an attribute of when it was created - it does have an attribute of when the file was last accessed and last written to (PHP: fileatime - Manual and PHP: filemtime - Manual ). The first thing that jumps out at me is to use a database. Store the file name, date it was created, and any other pertinent information regarding the image in the database. With SQL you can use ORDER BY on the date created column and you are pretty much done - you can even add a LIMIT 20 to only show 20 images. The other possibility is to store a timestamp as part of the images name: untitled-1213098600.jpg. Then just sort by the timestamp.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||||
|
Perhaps it should. As mentioned in my previous post, without manually logging it, I'm pretty sure it is impossible to get the creation date of the file.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||||
|
I figured a way around it with a help of a friend.. i will post what i did later.. atm i need help at something else..
okay so i do PHP Code:
but i want to strip the home.php.. so it shows /upload_script/whitey/ If you guys figure out how to do this before me let me know... EDIT: FIgured it out.. To fast for you ![]() PHP Code:
Last edited by Jaan; 06-11-2008 at 01:13 PM. Reason: Please use tags when you're posting your codes! |
| Sponsored Links |
|
|
|
|||||
|
PHP Code:
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||||
|
Why you do not using database? It's more secure and when you decide add some functions (features) you will see that it was good idea to use database system.
__________________
Free Web Templates like WebSpell, FrontPage and more. |
|
|||||
|
Yeah i understand that but this is the way i started it. I will be probably making a version 2 for that some other time.. But i am coding in all different aspects for learning purpose's so if i run into something like this later i will know how to do it.
![]() |
|
|||||
|
ShowTheUsersImagesMostRecentTwentyImages() - short and self describing name
![]()
__________________
Free Web Templates like WebSpell, FrontPage and more. |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Windows XP Tricks & Tips!!!!..new ones. | pranky | Tutorials | 9 | 08-23-2008 04:22 PM |
| What arrays and pointers have in common - or - Why arrays start at zero | Kernel | Programming News | 0 | 05-07-2008 08:36 AM |
| C++: How should you start learning it? | WingedPanther | C Tutorials | 8 | 03-25-2008 01:24 PM |
| IRC: Where do I start? | I like pie | General Programming | 1 | 04-27-2007 12:34 PM |
| Start a free domain service | xtraze | Hosting and Registrars | 8 | 01-11-2007 12:35 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |