How do you create a page dynamically on your website through PHP

Discussion in 'PHP' started by artist4today, Oct 7, 2011.

  1. #1
    I have created a content management system for my client's website that allows them to edit existing pages on their site through and admin portal. However recently, I was asked to create a button that would allow them to create an entire page on their site form the admin portal and then edit the page and publish to their website. How could we do something using PHP. Please help? I am not using Joomla or drupal on the site. I have used the tinyMCE wysiwyg editor for the content management system though.
     
    artist4today, Oct 7, 2011 IP
  2. mrmuggles

    mrmuggles Greenhorn

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #2
    Some PHP framework, like CodeIgniter, uses APACHE to redirect all of their requests to the page index.php. If you don't have Apache and use CodeIgniter, you'll see an URL like http://www.yoursite.com/index.php/myNewPage

    In that case, index.php has code that check the URL and load the content from the database based on this URL.

    Basically, you want to redirect all requests to the same php page. Then, in this page, write code that reads the URL and based on that, display content from your database.

    OR you could simply write a new ".php" file when your client adds a page... Make a basic template file and then copy it each time a page is added.

    (the first solution is better)
     
    mrmuggles, Oct 7, 2011 IP