|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello everybody, I'm pretty new to both php scripting and web development in general so bare with me for a second
Okay, so here is my problem: I have a website, which does not give me access to sql databases (its a free site). So what I've decided to do is create various directories on the server and place all my articles that i write in those directories. Then, when a user opens up the main page of my site I use a php script to: a) Get all the directories that I've created. b) Get all the files in all those directories. I'm using the glob() function for this (by the way, if I'm busy doing something incredibly stupid here, please, by all means tell me) c) Get the dates of when all the files were last edited and use it to determine what the latest article is, subsequently placing a brief description of it on the main page. Now, Is this the correct way to go about doing this? or should I rather use some kind of manually updated reference for my site, so that I would rather tell my site which article i wrote last instead of it having to find that out for itself. anyway thanks for the help, please dont persecute me too much if what i suggested here is ludicrous, I started web development three days ago and I have no idea what I'm doing Thanks again, Cheers. |
|
#2
|
|||
|
|||
|
You can "database" all of your articles with a flat file system. It's less overhead to just read and parse the file then it is to do all of that directory listing and parsing.
__________________
Errors have been made. Others will be blamed. Group Member, Dallas PHP Users Group <b>(DPUG)</b> --... ...--, Eric |
|
#3
|
||||
|
||||
|
and there is always SQLite - check it out for more info
other then that - for a small site to me it what you are thinking is doable thought it will see "problems" the more it grows (calling stat on 10 files vice 1000 files for example) Oh and rather then use glob (I personally don't like to directly send commands to the server command line with PHP) - I would recommend using the DirectoryIterator in the SPL (Standard PHP Library) if you are using PHP5. it is sweet and clean. for a tutorial on how to use it see http://www.phpro.org/tutorials/Intr...n-to-SPL.html#3
__________________
life is a game.... Have fun ----------------------------- http://www.phpwomen.org strength in unity PHPCommunity IRC #phpc on freenode |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Programming Theory > Content management... I think |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|