| Casual Articles |
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 |
|
Casual Articles - Using PHP and MySQL to Develop a Simple CMS - Version 1
HOLY SMOKE! Was THAT An Illegal Question? could have written Let's start out by saying that you should not be too worried about being asked an illegal interview question for devious, underhanded purposes. In most cases the interviewer is making innocent conversation, or trying to find out if you are going to be able to perform the essential duties of the job.Keeping that in mind, let's look at an example. Let's say that you see a job posting for a job that requires work on Sunday mornings. Let's also say that your resume states that you graduated from a prestigious Catholic University, and lists your hobby as President of your church's Young Professionals group. Assuming that your other experience on your resume makes you qualified for the job, would you consider it fair if the hiring manager overlooked your resume because he or she assumed that you'd be in church on Sunday mornings? Certainly not!The law states that you cannot be discriminated against because of $contents=$_POST['contents']; instead if we had wanted to. 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 < Top Ranking SEO Secret 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.Most web programmers and designers now have a good idea of how to optimize their site using on-site search engine optimization, such as keywords and page titles, but many don’t realize that the most important seo tool is link backs. Google and most of the search engines rank your page in importance according to the number of link backs it has from other sites. They see these as a sort of vote of confidence another site is giving you, and the more votes your site has, the better you will rank. Another important aspect is how well the page that links to your site ranks on the web and how many websites are linking to the page linking to your site. It sounds rather complicated but it’s really quite simple. SEO can be studied and applied by most web designers; it just takes time and research.The best way to start is by finding the sites that are ranking the highest in the search engines for your keywords. Then 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 Ad Tracking Software 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 < Winning your Clients through Effective Postcard Design 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).Postcards are essential marketing tools used at present. They are significantly used for advertisements, greeting cards, invitations, coupon cards and business reply. As an award winning tool they effectively grab customer’s attention.However do you want to know what comprises the material that you have in hand. The following are among the features that makes an effective postcard.1. Quality postcard card stockThe kinds of paper used are bright white and high quality 14pt gloss cover stock. The quality of the card possesses smooth and superior quality that makes it ideal for all your postcard printing jobs. Even without additional coating added, the cards are brilliant enough to grab your client’s attention.2. Postcard SizePostcards serve as a mini billboard for your campaign and advertising. It has various sizes that you can choose from. Orienting you with the sizes, the postcard st 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 < What is the Best Incentive? )Incentive schemes have been much criticised in recent years, and it is quite true that some schemes have been singularly unsuccessful. Their failure, however, has often been the result of inadequate planning, rushed introduction, or not thinking through such a scheme properly. These points should not be used to generally condemn other more successful applications.Whether any particular incentive scheme achieves long term success depends initially on the thoroughness with which the current working situation is reviewed, hence the need to re-look at some key Action Points, and question why you need an incentive scheme.1. Increase in earnings for employees? 2. Increase in output? 3. Improvement in quality? 4. Better mobility of labour? 5. More efficient methods of working? 6. Improvement in safety? 7. Higher housekeeping standards? 8. Reduction in absenteeism? 9. Redu 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 < 10 Reasons To Sell A Fee Based Subscription Ezine
1. You will create residual income. For example, if you charge a monthly subscription fee, you will get recurring income every month.2. You won't have to spend all your time marketing to gain new subscribers. Just get and keep enough subscribers to reach your monthly income goal.3. You can figure how many subscribers it'll take to meet your income goal. Note on your ad that you'll only accept a limited number of subscribers.4. You won't have any shipping or materials costs like offline subscription publications. You'll just have your internet access and web site expenses.5. You can sell back end or upsell products inside a fee based subscription ezine. It could be your own products or affiliate programs you've joined.6. You can start an affiliate program that will give people residual commission. People will want to join because it's residual instead of one time sales. could have written $contents=$_POST['contents']; instead if we had wanted to. 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 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:Interview Tip: Why Didn't You Get The Job? First $1000 Using Affiliate Marketing - Pay Per Sale Affiliate Marketing Bridging the Gap Between the Page, Keywords and Copywriting
|