Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Great reply! (as always) - just the information I was looking for.
Thanks for your help, Rob!
Chris
Copy link to clipboard
Copied
You're welcome. Good luck!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more