Create cms site with php - non framework based

hi all,

i want to create a cms site with using php it means really simple cms site that just can update, delete & create content then can have title and read more button - non framework right now, do you have some book or reference to do it :slight_smile:

thanks

Build Your Own Database Driven Website with PHP & MySQL by Kevin Yank and published by SitePoint (http://www.sitepoint.com/books/phpmysql4/) is one book that covers the creation of a simple CMS which doesn’t use any framework. There may be other books out there but the above book is the only one that I’ve read that covers the creation of a simple CMS.

Hi SpacePhoenix :slight_smile:

thanks for your answer, i will try to read it first.

hi all,

I am sorry this thread up again, I’ve read the book but still feel confused for one thing. I want to make that every article that I have input into the database automatically appear home page (index.php maybe?) and automatically index the article also has a maximum limit of characters and then the title of the article is a link that connects the article in full with a URL like this:

http://domainname.net/article_title_was_here/

how i can do something like this?

thank you

Create an extra field in your database call it “slug”. varchar, same length as your titles.

Take your article titles and turn them into “slugs”.

Lets say one title is “O’Reilly books that I REALLY Love!” turn that into the slug “oreilly-books-that-i-really-love”.

(search this forum for slug or slugify to find out how to do that).

Create an articles.php file which expects a single GET argument, which will be that slug:

domain .com/articles.php?article=oreilly-books-that-i-really-love

articles.php will then query your database for the match to get a single article, and display it.**


"SELECT title, text 
FROM articles 
WHERE slug = '" .$_GET['article'] ."'";

You can then create a list of articles and links by doing:


"SELECT title, slug 
FROM articles 
order by title";

Now, you can then go on and create SEO friendlier URLS such as

domain .com/oreilly-books-that-i-really-love

… by looking up and reading about Apache’s mod_rewrite which turns (re-writes) that SEO friendly url into the exact link domain .com/articles.php?article=oreilly-books-that-i-really-love

When that is done you can go back to your home page and rearrange the links so that they link to the SEO friendly version instead.

Then you are done.

There is a bit of a learning curve, but once done you will likely use this a lot.

** You need to sanitize this input, I have left this step out - but it should be easy enough - a slug should be between 4? and n chars long, and contain only letters numbers and a dash.