Atricle Dump
#1 in Business Subscribe Email Print

You are here: Home > Internet and Businesses Online > Web Development > Using PHP and MySQL to Develop a Simple CMS - Version 2

Tags

  • needs
  • marketers
  • contents
  • modification updatepagehtm
  • database contents
  • editpagephp because

  • Links

  • Ten Great Ideas for a New Baby
  • Honeymoon Cabins in Gatlinburg
  • Defined Benefit Pension Plans
  • Atricle Dump - Using PHP and MySQL to Develop a Simple CMS - Version 2

    Various Techniques of Search Engine Optimization
    SEO techniques are effective procedures to put a website on the first page of search engines such as Google, Yahoo, and MSN for your targeted keywords. These techniques directly help in raising the SERPs (search engine result positions) of the site, increase site traffic
    w = mysql_fetch_assoc($result)){
    11. $contents = $row['contents'];
    12. }
    13. ? >
    14. < form name="form1" method="post" action="updatePage.php" >
    15. Enter page content:< br >< textarea rows="10" cols="60" name="contents" >< ?php echo "$content
    Protective Clothing Protects Your Business
    IntroductionTechnical treatment of different textile materials is laid down blizzard to the world. In this globalization of science and technology, new technologies like fine chemicals, optical fibers, high polymer plastics, resins, temperature-resistant textile fi
    In version 1 of our simple CMS we introduced the following four files:

    • cms.sql
    • updatePage.htm
    • updatePage.php, and
    • index.php
    • Together, these files formed a very simple CMS, which you can download from the following address:

      http://www.computernostalgia.net/downloads/cms_v1.zip

      In this article we'll extend the CMS slightly so that the database contents are extracted and presented in the form (UpdatePage.htm). This will make it easier to edit the contents, rather than simply overwriting them.

      In order to make this modification, updatePage.htm needs to become a PHP file. I've called it editPage.php because updatePage.php already exists.

      Here is the contents of editPage.php:

      1. < html >
      2. < head >
      3. < title >Really Simple CMS< /title >
      4. < /head >
      5. < body >
      6. < h1 >Really Simple CMS< /h1 >
      7. < ?php
      8. mysql_connect("localhost", "root", "password");
      9. $result = @mysql_query("SELECT contents from cms.page");
      10. while ($row = mysql_fetch_assoc($result)){
      11. $contents = $row['contents'];
      12. }
      13. ? >
      14. < form name="form1" method="post" action="updatePage.php" >
      15. Enter page content:< br >< textarea rows="10" cols="60" name="contents" >< ?php echo "$contents

      The Truth About Massage Therapist Career
      The life of a massage therapist may be a dream for some and a disaster others. There are a number of facets to massage therapy that many people do not want to have any part of, yet the career may interest a great deal of people as a branch of physical medicine. The truth
      ollowing address:

      http://www.computernostalgia.net/downloads/cms_v1.zip

      In this article we'll extend the CMS slightly so that the database contents are extracted and presented in the form (UpdatePage.htm). This will make it easier to edit the contents, rather than simply overwriting them.

      In order to make this modification, updatePage.htm needs to become a PHP file. I've called it editPage.php because updatePage.php already exists.

      Here is the contents of editPage.php:

      1. < html >
      2. < head >
      3. < title >Really Simple CMS< /title >
      4. < /head >
      5. < body >
      6. < h1 >Really Simple CMS< /h1 >
      7. < ?php
      8. mysql_connect("localhost", "root", "password");
      9. $result = @mysql_query("SELECT contents from cms.page");
      10. while ($row = mysql_fetch_assoc($result)){
      11. $contents = $row['contents'];
      12. }
      13. ? >
      14. < form name="form1" method="post" action="updatePage.php" >
      15. Enter page content:< br >< textarea rows="10" cols="60" name="contents" >< ?php echo "$content

      10 Packaging Trends That Will Make Consumers Buy In 07
      People are sick of conventional advertising. Let’s face it, most of today’s ads aren't working or, at best, aren't generating sales. So marketers need other methods of communicating the product’s worth to the consumer. The package becomes an obvious and valuable means to
      er than simply overwriting them.

      In order to make this modification, updatePage.htm needs to become a PHP file. I've called it editPage.php because updatePage.php already exists.

      Here is the contents of editPage.php:

      1. < html >
      2. < head >
      3. < title >Really Simple CMS< /title >
      4. < /head >
      5. < body >
      6. < h1 >Really Simple CMS< /h1 >
      7. < ?php
      8. mysql_connect("localhost", "root", "password");
      9. $result = @mysql_query("SELECT contents from cms.page");
      10. while ($row = mysql_fetch_assoc($result)){
      11. $contents = $row['contents'];
      12. }
      13. ? >
      14. < form name="form1" method="post" action="updatePage.php" >
      15. Enter page content:< br >< textarea rows="10" cols="60" name="contents" >< ?php echo "$content

      You Can Have Graphics And Good SEO!
      As webmasters and online internet marketers, we sometimes lose sight of what the real goal in marketing is – to sell products/services. It often happens that we end up writing most of our content to please the search engines. Let me tell you, search engines do not buy s
      3. < title >Really Simple CMS< /title >
      4. < /head >
      5. < body >
      6. < h1 >Really Simple CMS< /h1 >
      7. < ?php
      8. mysql_connect("localhost", "root", "password");
      9. $result = @mysql_query("SELECT contents from cms.page");
      10. while ($row = mysql_fetch_assoc($result)){
      11. $contents = $row['contents'];
      12. }
      13. ? >
      14. < form name="form1" method="post" action="updatePage.php" >
      15. Enter page content:< br >< textarea rows="10" cols="60" name="contents" >< ?php echo "$content
      Hong Kong Clothing Industry
      OverviewTextile quotas were eliminated among WTO members at the first day of 2005 in accordance with the Agreement on Textiles and Clothing (ATC). However, resistance to quota removal spread in the US and EU. Subsequently, China reached agreements with the EU and t
      w = mysql_fetch_assoc($result)){
      11. $contents = $row['contents'];
      12. }
      13. ? >
      14. < form name="form1" method="post" action="updatePage.php" >
      15. Enter page content:< br >< textarea rows="10" cols="60" name="contents" >< ?php echo "$contents" ? >< /textarea >


      16. < input type="submit" name="Submit" value="Update Page" >
      17. < /form >
      18. < /body >
      19. < /html >

    Most of this file is fairly simple HTML that doesn't need explaining. However, the following bits of code are probably worth discussing.

    Lines 7 through to 13 containt PHP code to connect to the database and extract the contents of the web page.

    Line 15 contains a tiny bit of PHP code to display the contents in the form's textarea. This line shows how easy it is to integrate bits of PHP code into lines of HTML code.

    Remember though that in order to use PHP code in an HTML page, the file has to have an extension of .php.

    All of the files for version 2 of the CMS are available at:

    http://www.computernostalgia.net/downloads/cms_v2.zip

    HTTP = HTML link (for blogs, profiles,phorums):
    <a href="http://www.articledump.net/article/86444/articledump-Using-PHP-and-MySQL-to-Develop-a-Simple-CMS--Version-2.html">Using PHP and MySQL to Develop a Simple CMS - Version 2</a>

    BB link (for phorums):
    [url=http://www.articledump.net/article/86444/articledump-Using-PHP-and-MySQL-to-Develop-a-Simple-CMS--Version-2.html]Using PHP and MySQL to Develop a Simple CMS - Version 2[/url]

    Related Articles:

    Fun Marketing Gifts For Summer Events And Festivals

    A Leadership Screw Driver: The 90 Day Improvement Plan

    How To Break Every Sales Record In Your Company

    Bookmark it: del.icio.us digg.com reddit.com netvouz.com google.com yahoo.com technorati.com furl.net bloglines.com socialdust.com ma.gnolia.com newsvine.com slashdot.org simpy.com shadows.com blinklist.com