Programming Theory
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesProgramming Theory

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 18th, 2007, 10:40 AM
jimmyjack jimmyjack is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 1 jimmyjack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Content management... I think

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.

Reply With Quote
  #2  
Old November 26th, 2007, 09:32 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 5
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 &lt;b&gt;(DPUG)&lt;/b&gt;
--... ...--, Eric

Reply With Quote
  #3  
Old December 1st, 2007, 08:30 AM
lig's Avatar
lig lig is offline
"Forum Nazi"
Codewalkers Demi-God (4500 - 4999 posts)
 
Join Date: Apr 2007
Location: Jacksonville, Fl
Posts: 4,753 lig User rank is Private First Class (20 - 50 Reputation Level)lig User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 8 h 15 m 54 sec
Reputation Power: 7
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

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesProgramming Theory > Content management... I think


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek