basic cms script

Posted on 2012-09-03
Last Modified: 2012-09-04
ok I know... should be wordpress or joomla but it wasn't my desicion.  My client now wants to edit a deals page for tours on his html website.  We are into enough that a conversion to wordpress will cost a few hundred to do.  Since he wants to edit the basic elements on one page is there a basic php script that I can use to give him a cms like admin panel for one page?
Question by:tf2012
    LVL 49

    Accepted Solution

    Writing a CMS is not that difficult - it depends on what you want to do.

    1. Create a database to store the information

    Two things - will the data be structured or unstructured.

    Structured would be like a product (Price, SKU, Description, Category) are all fields that can be captured.

    Unstructured is free form

    If Unstructured create a simple table that stores the content (text) and potentially, page title, header etc - depends on requiements.

    If structured create table to match requirements.

    2. In your html page turn this into a template.

    i) At the top add the code to fetch your data from the database.
    ii) In the html replace the static sections with the data you retrieved from the DB.

    That's the front end done.

    Backend - build a simple page with a form to edit the data. On load it retrieves the data from the database (or file - if simple enough does not have to be a db).

    Add a simple login and you are done.
    LVL 107

    Assisted Solution

    by:Ray Paseur
    LVL 33

    Assisted Solution

    greetings  tf2012, , Not sure I see the "Logic" for having a "Content Management System" for just a page or two of your site, Although there are hundreds of PHP CMS code containers that do more than what you need (I guess from your question), a CMS is meant to manage content for an entire Large web site, so you asking for a PHP script that does NOT use a CMS does seem better to me. Like when you said -"is there a basic php script that I can use to give him a cms like admin panel for one page (without a CMS ton of code)? "
    I have NOT ever looked for that sort of thing, but I have used some Javascript "what you see is what you get" text editors, you should be able to have your client do his own HTML modifications with one of these - have a look at this web page, for a listing of JS text editors -

    the TinyMCE is popular and works, but has a large js file size, and may have TOO MANY options to choose from.

    I would suggest that instead of a complicated (or simple) PHP administrative "Log IN" for your client, you might use the CPanel (or the htaccess) to make a user-password directory, with the javascript-rich-text-editor PHP administrative page in that, You will need to make the PHP code for that javascript-rich-text-editor, with your own web theme header, footer images and arrangement, but you'll have to deal with that even in  a pre-made PHP package for this.

    I web searched for some PHP that did what you want, but I could not get the correct search string, to have any useful results.
    Hope I have the right Idea about what you may need, ask questions if you need more Info.
    LVL 107

    Assisted Solution

    by:Ray Paseur
    One comment on TinyMCE (and this comment may be outdated since in my experience the issue arose in 2009)... If you have a Word for Windows document and you cut/paste from the Word document into the TinyMCE textarea, you will get an unholy mess.  In case you go this way, you will need to either figure out how to clean up the mess or carefully instruct your client to avoid copying Word documents into the text area.  Unfortunately, that is a very tempting thing to do.  "It looked perfect in the Word document - why is it so screwed up on the web site?"
    LVL 49

    Assisted Solution

    by:Julian Hansen
    Writing a CMS on this scale is a very straight forward exercise - I have done many and built my own CMS framework.

    If you are going to do WYSIWYG editing then tinyMCE or FCKEditor are good options - but I would check before using them as they do add a level of complexity that is not always good. Many of my clients use the html button on tiny to get at the underlying html code because they don't like the default formatting that tiny does.

    Slick812's suggestion of using .htaccess for access control is a good one and if the requirement is simple enough you don't even need a database. A text file or XML file will suffice.

    I am not sure I understand the comments about a CMS being complicated - it is no more so than a form on a website that captures and processes information.
    LVL 1

    Author Closing Comment

    thnx, convinced customer to let convert site to wordpress
    LVL 107

    Expert Comment

    by:Ray Paseur
    That's probably best for everyone involved!  Thanks for the points, ~Ray

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now