Page 1 of 1

PhP Article Help

Posted: Sun Feb 01, 2004 7:12 pm
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

Posted: Mon Feb 02, 2004 1:03 am
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.