You are here: Re: News-Site kind of url « PHP Programming Language « IT news, forums, messages
Re: News-Site kind of url

Posted by frizzle on 12/15/05 22:11

NC wrote:
> frizzle wrote:
> > NC wrote:
> > >
> > > First of all, it is entirely possible that HTML pages you are referring
> > > to are in fact static. Some content management systems actually
> > > separate writing, editing, and publication. An article can be
> > > submitted by the author and stored in a database until the editor
> > > approves its publication, at which point static HTML files are created
> > > and publication's home page and RSS feeds are updated.
> >
> > how would you edit/update these?
>
> You wouldn't. You would edit the articles stored in the database and
> then re-publish (overwrite old static HTML files with new ones).
>
> > > Now to your question. If you do decide to use mod_rewrite in the
> > > above-described fashion, you can simply do something like this:
> > >
> > > if (is_numeric($_GET['article'])) {
> > > $id = (int) $_GET['article'];
> > > $query = "SELECT * FROM articles WHERE id=$id";
> > > // Execute the query and display the article...
> > > }
> > > else {
> > > $search = $_GET['article'];
> > > switch $search {
> > > case 'hot_news':
> > > $query = "SELECT * FROM articles ORDER BY id DESC LIMIT 5";
> > > break;
> > > // more case statements here...
> > > }
> > > // Execute the query and display the article headers/teasers...
> > > }
> >
> > And for your solution to my 'problem'; i meant how to handle DB-entries
> > if not reffered to them as ID's, but as actual topic names ...
>
> This is exactly what the above does. If $_GET['article'] is a number,
> it is interpreted as an article ID, and the script shows full text of
> the article. If it is not, it is interpreted as a topic identifier,
> and the script displays only headers and/or opening paragraphs and
> links to full text. Topic 'hot_news', in particular, includes five
> most recent articles...
>
> Cheers,
> NC

Thanks for al the replies!
I think Dikkie Dik convinced me of how to do it.
But NC (not to be a nag) but topics on the page in my example,
www.nieuwnieuws.nl,
can be commented. Wouldn't there be a bigger risk in rewriting the
pages then
insert new comments in a DB?

Thanks! Frizzle.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация