PhP Article Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
no_memories
Forum Contributor
Posts: 145
Joined: Sun Feb 01, 2004 7:12 pm
Location: New York City

PhP Article Help

Post by no_memories »

I'm new to PhP.

I am interested in setting up an article directory so that specific article(s) can then be called into a given template.

So say I have directory "A" something like http://test.me.com/articles/

and I have a link on another page page that calls a specific article within that article directory. The link might look like http://test.me.com/articles.php?getid=105 and would load the target article into this example template page.

What I would like to know, is there an easy way to impliment something like this?

I'm sure there are several ways and easy to use PhP scripts. I'm just so PhP ignorant, I am not sure where to begin.

Thanks for any help
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Assuming your articles are all saved as article1.html, article2.html in that directory:

get the requested article_id, will be in $_REQUEST['article_id'] or whatever
double check they requested a valid integer.
open /articles/$id.html, read it, output it.
Post Reply