i have a db lthat i want to publish. it''s full of articles and i want it to work this way:
there are ten categories (sex, health,....)
once you click one of this category you go to a page where there are some articles (about sex, about health,...).
at this point is my problem. i'd like to find a way to click an article and have the code generating a new page for me with that article. is this possible?
to eplain:
this is sexuology.php with these:
article 1
article 2
article 3
once i click a new page is generated on the fly to let me read the whole article
how can i do,
pacho
auto generated pages
Moderator: General Moderators
First you need a view article script. At its simplest, this would take an article id and then query the database to get the article data. If access to articles is restricted in any way (say to registered members of your site only) you need to perform a check for that as well. There could be other tasks like a views counter - and you probably want to check the article id does in fact exist (it might have been deleted, or you might have some speculative query string tampering).
To view an article, just hyperlink the title - or a "view article" button, whatever. The hyperlink calls the view article script, passing the article id via GET.
To view an article, just hyperlink the title - or a "view article" button, whatever. The hyperlink calls the view article script, passing the article id via GET.