| Actual for You |
Hubs | Hubbers | Topics | Request |
| #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 1 |
|
Actual for You - Using PHP and MySQL to Develop a Simple CMS - Version 1
No Budget? No Problem! How to Market Your Business on a Shoestring MySQL database server, setting up the host name, which I've assumed to be localhost, the database user, which I've assumed to be root, and the password needed to connect to the database. I have no idea what this would be for your system so I've just written the word password.All of us in the business world understand the importance of marketing. It is a strategy to get your product or service known to a target market. It is done in an effort to increase sales and generate revenue. However, many small businesses get caught in a catch 22. They don’t have money to advertise and market their business, so they aren’t able to generate more sales and revenue. Since they aren’t able to increase revenue, they continue not to have money to invest in marketing strategies. Yet consumers can’t purchase products they don’t know about.Don’t let the myth that big budget marketing strategies are going to generate more business. The focus should be on the quality of the advertising rather than the cost of it. While having a limited budget for marketing can be intimidating, you can still make it work for your business if you have a plan.Creative marketingThere are creat Line 4 updates the page table in the cms database with the new contents. Line 5 closes the database connection. Line 6 closes the PHP script. index.php 1. < html > This is the web page that displays the contents from the database. It's called index.php rather than index.htm because the web page contains PHP code. If the page was called index.htm, the PHP preprocessor, which is part of the SEO Useful Basic Tips In this article I'll try to describe how to develop a very simple Content Management System (CMS). I've chosen PHP as the server-side scripting language and MySQL as the database management system purely because I think they are fairly easy to use and they do the job very well.1. Do not make your title from your webpage long. This is because Google, Yahoo, MSN and all the other (mayor) search engines have a limit on reading the title from your webpage. Make your webpage title as much effective as you can, get to the point instantly and put some good keywords in it.2. Do not duplicate your content on your site, this will work negatively. Use unique content on each page.3. Good keywords help you, but only with good keywords you won’t come far. You have to do some marketing and advertisements like participating in forums and build your reputation up.4. Do not hesitate to submit questions on SEO forums. Knowing more is more important than knowing less.5. Link exchange helps, unless you exchange links with a website that does not have a lot of visitors. To know how much a website is visited, download the Google toolbar (http://www.google.com/toolbar/) and look at the I won't spend any time describing CMSs, what they are, or why you should or should not use them as there are plenty of excellent articles on this site that describe them perfectly well. I'll just explain one way of developing one. This CMS consists of a single web page (index.php) that can have its contents updated by use of a standard form (updatePage.htm). The contents entered via the form are stored in a database, and are accessed and displayed by the web page. Although this CMS is too simple to be of any real use, it could be used as the starting point for a real life CMS solution. In subsequent articles I'll look at various ways to extend the CMS to make it more useful. There are four files in this project:
cms.sql updatePage.htm updatePage.php index.php You can download a zip file containing these four files from http://www.computernostalgia.net/downloads/cms_v1.zip cms.sql 1. CREATE DATABASE cms; Line 1 creates a database called cms in the MySQL database management system. Line 2 tells MySQL to use the database for the subsequent commands. Line 3 creates a table in the database. Line 4 creates a column called pageID, which will contain integers, and which will be automatically incremented as new records are added to the table. As we only have one web page (index.php) in our imaginary website, we will only have one record and therefore one integer: 1. If we added additional pages to the table, they would be automatically numbered (2, 3, 4, etc). Line 5 creates a second column called contents, which will contain text. This is where the editable contents displayed by index.php will be stored. Line 6 sets pageID as the primary key, which you can think of as a reference for the table. As we only have one table, which will contain only one record, we won't make any use of the key. I've included it though because it's good practice to do so. Line 7 simply closes the bit of code that was started in line 3. Line 8 inserts some intial data into the table: 1 as the first (and only) pageID, and 'dummy text' as the contents of the first record. updatePage.htm (Note that for display considerations, I've inserted spaces into the HTML tag names, otherwise they would be processed as HTML code.) 1. < html >
This is just standard HTML, which probably doesn't really need explaining. All it does is present a form, the contents of which are sent to updatePage.php when the 'Update Page' button is clicked. updatePage.php 1. < ?php This is the form handler, that's to say, the script that processes the data entered into the form (in updatePage.htm). Line 1 signifies the start of a PHP script. Line 2 requests the contents that were posted from the form. We could have written Line 3 connects to the MySQL database server, setting up the host name, which I've assumed to be localhost, the database user, which I've assumed to be root, and the password needed to connect to the database. I have no idea what this would be for your system so I've just written the word password. Line 4 updates the page table in the cms database with the new contents. Line 5 closes the database connection. Line 6 closes the PHP script. index.php 1. < html > This is the web page that displays the contents from the database. It's called index.php rather than index.htm because the web page contains PHP code. If the page was called index.htm, the PHP preprocessor, which is part of the w Marketing With Blogs - Part 1 d creates a table in that database called page. It also loads some intial data into the table. You only need to use this file once.Marketers have found that blogs are excellent tools for communicating with their audience. Anyone who has something to sell or an idea to promote can benefit from using blogs.Corporates like Nike are using blogs to build branding. Microsoft and Sun are using them to communicate with the developer community.Blogs have a number of advantages that make them excellent tools for communication.They are cheap to install and require little or no technical expertise. So the entry point for blogging is very low when compared to the expense of hiring a website designer.While building a website is often out of the reach of most solo entrepreneurs, anyone can start a blog. If you can’t write or hate to write, you can start an audio or video blog. The possibilities are endless.Blogs also help you create content that search engines love, and encourage linking from a number of other bloggers who wri updatePage.htm updatePage.php index.php You can download a zip file containing these four files from http://www.computernostalgia.net/downloads/cms_v1.zip cms.sql 1. CREATE DATABASE cms; Line 1 creates a database called cms in the MySQL database management system. Line 2 tells MySQL to use the database for the subsequent commands. Line 3 creates a table in the database. Line 4 creates a column called pageID, which will contain integers, and which will be automatically incremented as new records are added to the table. As we only have one web page (index.php) in our imaginary website, we will only have one record and therefore one integer: 1. If we added additional pages to the table, they would be automatically numbered (2, 3, 4, etc). Line 5 creates a second column called contents, which will contain text. This is where the editable contents displayed by index.php will be stored. Line 6 sets pageID as the primary key, which you can think of as a reference for the table. As we only have one table, which will contain only one record, we won't make any use of the key. I've included it though because it's good practice to do so. Line 7 simply closes the bit of code that was started in line 3. Line 8 inserts some intial data into the table: 1 as the first (and only) pageID, and 'dummy text' as the contents of the first record. updatePage.htm (Note that for display considerations, I've inserted spaces into the HTML tag names, otherwise they would be processed as HTML code.) 1. < html >
This is just standard HTML, which probably doesn't really need explaining. All it does is present a form, the contents of which are sent to updatePage.php when the 'Update Page' button is clicked. updatePage.php 1. < ?php This is the form handler, that's to say, the script that processes the data entered into the form (in updatePage.htm). Line 1 signifies the start of a PHP script. Line 2 requests the contents that were posted from the form. We could have written Line 3 connects to the MySQL database server, setting up the host name, which I've assumed to be localhost, the database user, which I've assumed to be root, and the password needed to connect to the database. I have no idea what this would be for your system so I've just written the word password. Line 4 updates the page table in the cms database with the new contents. Line 5 closes the database connection. Line 6 closes the PHP script. index.php 1. < html > This is the web page that displays the contents from the database. It's called index.php rather than index.htm because the web page contains PHP code. If the page was called index.htm, the PHP preprocessor, which is part of the Internet Marketing: Keyword Stuffing – Good Idea or Bad Policy? egers, and which will be automatically incremented as new records are added to the table. As we only have one web page (index.php) in our imaginary website, we will only have one record and therefore one integer: 1. If we added additional pages to the table, they would be automatically numbered (2, 3, 4, etc).Keywords are an important function of Internet marketing. The use of a specific set of keywords or phrases can help a website earn better rankings with search engines, but how much is too much?A friend of mine was asked once to provide content for a website where the key phrase had three words and that key phrase had to be used ten percent of the time. In other words, for every 100 words written the phrase has to be included 10 times. To put that in perspective the article could only have seventy original words in one hundred because the other thirty words were tied up in the mandatory use of a key phrase. My friend turned the work down.Why?Because he understood that the only way to write content with a key phrase count that high would be to stuff the article and force the use of the key phrase even when it would not be normal to do so.Perhaps you have been to websites that have content tha Line 5 creates a second column called contents, which will contain text. This is where the editable contents displayed by index.php will be stored. Line 6 sets pageID as the primary key, which you can think of as a reference for the table. As we only have one table, which will contain only one record, we won't make any use of the key. I've included it though because it's good practice to do so. Line 7 simply closes the bit of code that was started in line 3. Line 8 inserts some intial data into the table: 1 as the first (and only) pageID, and 'dummy text' as the contents of the first record. updatePage.htm (Note that for display considerations, I've inserted spaces into the HTML tag names, otherwise they would be processed as HTML code.) 1. < html >
This is just standard HTML, which probably doesn't really need explaining. All it does is present a form, the contents of which are sent to updatePage.php when the 'Update Page' button is clicked. updatePage.php 1. < ?php This is the form handler, that's to say, the script that processes the data entered into the form (in updatePage.htm). Line 1 signifies the start of a PHP script. Line 2 requests the contents that were posted from the form. We could have written Line 3 connects to the MySQL database server, setting up the host name, which I've assumed to be localhost, the database user, which I've assumed to be root, and the password needed to connect to the database. I have no idea what this would be for your system so I've just written the word password. Line 4 updates the page table in the cms database with the new contents. Line 5 closes the database connection. Line 6 closes the PHP script. index.php 1. < html > This is the web page that displays the contents from the database. It's called index.php rather than index.htm because the web page contains PHP code. If the page was called index.htm, the PHP preprocessor, which is part of the Change And Confusion: Time To Refocus >Our world seems confused right now! Should we move forward or stay right where we are? Who knows the answers?Confusion is an opportunity to stop and refocus. It is a warning signal our mind sends us saying "HELP! Do something different!" So what does our brain want and how can we refocus?Here are 7 steps to assist this process.1. STOP The definition of insanity of doing the same thing over and over and expecting different results. So STOP the insanity!2. WRITE Put all the scrambled thoughts onto paper. Would you rather be swept up in the churn of the tornado or safely watch the event from the next town? By writing your thoughts, you remove yourself from the "churn" and can look at the confusion from a safe distance.3. IDENTIFY Now you can safely look at your thoughts and begin to identify categories that are creating the confusion. Often it is not as undaunting a list as 4. < /head > 5. < body > 6. < h1 >Really Simple CMS< /h1 > 7. < form name="form1" method="post" action="updatePage.php" > 8. Enter page content:< br >< textarea rows="10" cols="60" name="contents" >< /textarea >
This is just standard HTML, which probably doesn't really need explaining. All it does is present a form, the contents of which are sent to updatePage.php when the 'Update Page' button is clicked. updatePage.php 1. < ?php This is the form handler, that's to say, the script that processes the data entered into the form (in updatePage.htm). Line 1 signifies the start of a PHP script. Line 2 requests the contents that were posted from the form. We could have written Line 3 connects to the MySQL database server, setting up the host name, which I've assumed to be localhost, the database user, which I've assumed to be root, and the password needed to connect to the database. I have no idea what this would be for your system so I've just written the word password. Line 4 updates the page table in the cms database with the new contents. Line 5 closes the database connection. Line 6 closes the PHP script. index.php 1. < html > This is the web page that displays the contents from the database. It's called index.php rather than index.htm because the web page contains PHP code. If the page was called index.htm, the PHP preprocessor, which is part of the How To Change Others At Work MySQL database server, setting up the host name, which I've assumed to be localhost, the database user, which I've assumed to be root, and the password needed to connect to the database. I have no idea what this would be for your system so I've just written the word password.The people we work with can affect how we feel about our job because of our working relationships with them. First, we must remember not to allow the bad behavior of others steal our peace of mind. We all know how hard it is to hold our tongue and remain mentally calm when we are irritated by other people. It is impossible for us to go through life saying to everyone that irritates or annoys us how to behave because tremendous resentment is created from unsolicited advice. Unless the people around you have asked for counsel one should not try to impose their beliefs or thoughts upon them. The mistake made by novices is that the moment they feel inspired they try to change the whole work place with an all out revolution to convert everyone, but this type of eagerness arouses antagonism in the work place. No one wants to be told what to do when they are not seeking guidance; you must change your self first and others w Line 4 updates the page table in the cms database with the new contents. Line 5 closes the database connection. Line 6 closes the PHP script. index.php 1. < html > This is the web page that displays the contents from the database. It's called index.php rather than index.htm because the web page contains PHP code. If the page was called index.htm, the PHP preprocessor, which is part of the web server, would not know that the page contained PHP code, and would therefore not try to process the script part of the page (lines 6 to 13). This would cause the script itself to be displayed in the browser rather than the HTML generated by the script. Most of the lines in this web page are pretty straight forward and don't need explaining. Lines 6 to 13 contain the PHP script that extracts the contents from the database and displays (echos) it in the browser. Installing/Running the CMS To use the CMS you need to copy the files onto your web server into the area allocated for web pages. Your web server needs to support PHP and MySQL; if it doesn't, the CMS won't work. You also need to use the correct database connection names and passwords (those used in the mysql_connect lines in the PHP scripts). Exactly how you run the cms.sql file to set up the database and database table will vary from web server to web server so it's difficult to give precise instructions here. If you have a phpMyAdmin icon or something similar in your web servers control/administration panel you should be able to use that. Once you've set up the database and table, you can simply browse to the updatePage.htm web page and update the database contents. You can then browse to the index.php page to view the updates. If you have any problems or comments regarding the CMS, please email me at johndixon@computernostalgia.net and I'll be pleased to assist you if possible.
HTTP = HTML link (for blogs, profiles,phorums):
Related Articles:5 Steps To Avoid Losing Your Shirt Operational Risk Management Awareness
|