Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Editable Pages For Content Manager

Guest
May 08, 2012 May 08, 2012

Hi

On my website I would like my friend/the client to be able to login (there will be only one user) and after he logs in - some of the pages should 'change' to allow user input/edits.

I have designed the pages - both editable (with forms) and non editable (just content). - ((The website uses PHP and a MySQL database.))

What is the recommended way/'best' way to send the logged in user to the editting pages - and the general guest to the non-edit pages?  - Do I use separate pages - or should I use conditionals on a single page to display content/forms based on the person viewing the site?

In otherwords - I want to create a very basic CMS for my client after he has logged in.

Thanks!

Chris

TOPICS
Server side applications
840
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
May 08, 2012 May 08, 2012

1. Make a directory in the website. I name mine "admin." This directory will be password protected, or protect access using sessions.

2. I don't know how you organized your database, but normally the content for all the pages will be in a single table (in some cases a set of joined tables). To edit the content of a page, you need to populate a form in your admin system with the desired page content. So first you have a menu page which lists the pages (i.e. contact, home page, etc.). The items listed should link to the form that edits the page content and opens it up with the appropriate page content.

For instance, you can use the GET variable to send the appropriate page ID, like this:

edit_page.php?page_id=7

The edit page will contain a form with fields such as TITLE, MAIN_PHOTO, MAIN_CONTENT, LEFT_COLUMN_CONTENT.

The content fields will use the textarea form field type and usually you want to connect them to a WYSIWYG editor like TinyMCE or CKeditor. My preference is CKeditor. Using such an editor gives the content manager the ability to format text, create lists, add images, etc.

There is an eBook called Build Your Own Database Driven Website Using PHP & MySQL, published by Sitepoint. It isn't the best book about PHP/MySQL, but it does focus on the elements of a basic CMS.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 09, 2012 May 09, 2012

Great reply! (as always) - just the information I was looking for.

Thanks for your help, Rob!

Chris

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
May 09, 2012 May 09, 2012
LATEST

You're welcome. Good luck!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines