Moving your site from html to phpMoving Your Site from Html to Php

Call me a dope. I own and have worked on one of the oldest web pages on the internet. Sillybilly.com. When I first developed the site, I created the entire thing by typing the code in note pad.
Back then, when you had a web site it was like being one of the first people to have a telephone.

Imagine you were one of only 100 people with a telephone. You could email, call, the BBC, tell them that you had a web site too, and ask them to link to your site. They would say yes, no problem. That is literally the way it was.

Well, lots has changed since then. Now my site has about 900 pages. In those 900 pages there are thousands of links, images, Flash, videos and all kinds of other stuff. The format of the site has changed dramatically over the last 20 years. Every couple of years, you just have to adapt to the new styles, css, and capabilities of the internet.

You small business owners that built your own web sites like me understand that if you want to change your site, or if you come up with that new product or image that should go on each of your 900 pages is going to be a real pain in the ass to change.

Sure, I’m a geek. I’m a damn good geek. My html, css, Photoshop, Illustrator, Flash, Actionscript and other web skills are excellent. But, as Dirty Harry once said, “A man has to know his limitations.”

Other geeks would tell me, “Ya know, you really should be thinking about moving your html site to php.” Yeah right. One more big renovation to make and a new language to learn. I waited and waited. I fought it and fought it, basically, because I didn’t really know how easy it would be and what the massive benefits would be.

Then came along Joomla, Drupal, and WordPress.

One of my very bright clients heard about this new thing about 6 years ago called, “Content Management Systems.” I was doing major Flash work for him, so he asked me to investigate the various systems and come up with one that would be the best for him. I didn’t know anything about it, so I did my Ivy League research methods and picked Joomla. I lived in his site for about 3 years using Joomla.

It was pretty damn cool. All of the things I wanted to do on my web site, I was doing very easily on his. Major site wide menu changes took seconds. Adding banners on all pages for special promotions was a quick, easy timeless breeze.

I looked at my site, but Joomla was very “Theme” oriented, and I didn’t find a theme that fitted my needs. Though, I had to rebuild his theme learning how to manipulate the 3,000 lines of CSS that made his Joomla site work.

From Joomla to WordPress

Then the WordPress Craze came to be. Clients by the hundreds were asking me about WordPress. And of course I thought to myself, “Another Web Craze.” But, I had clients that wanted WordPress.

So here we go again. I had to learn it, teach it, edit it, control it, master it. The WordPress Craze was here to stay.

I have a couple of WordPress Sites. I have them just for fun. They serve their purpose. I had to learn the basic and advanced issues in WordPress, specifically the widgets, plugins and CSS. I left the php alone. Then I started looking at the PHP. Ends up that all these Content Management Systems are just a bunch of What you call PHP includes, and they are pretty simple.

The Problem with WordPress and Other CMS Sites. Can You say Hackers.

Hackers are just sitting around with nothing to do just figuring how can they ruin your day. I have Macs. Generally speaking, Hackers don’t create viruses for Macs. Hackers want to screw with millions or billions of people, they don’t want to screw with the 10 of us on the planet that own Mac Hard Drives.

Same is true with WordPress. Hackers are getting to know what WordPress themes, plugins and widgets are being used and they get to know them well. Then they hack the WordPress system and lots of people become miserable. It’s happening every day.

Funny thing. I read lots of forums that have hundreds of WordPress site workers. I call them WordPress site workers because most of them, I would say 90 percent of them know very little html, Zero CSS, and can’t spell PHP, and,,,,,,they are making lots of money.

Moving Your Site from html to php.

So here’s what I came up with. My html is excellent, my css is excellent, my responsive skills are excellent, so I figured I could learn my own php and make my life a lot easier. And that I did.

I started with one basic line of php. You can look it up, search for “php include code.” Here’s how it works.

Lets say you have a header with a logo in it and 20 menu items in the nav bar right below the log and maybe a slide show in there too.

So of course this isn’t real code, but I’m just going to use this as an example

<div header>

bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,

</div><!–Close the header here–>

Notice that this is a CSS Div. That’s important to consider. Ok. What I do is save this block of code as

“myheader.php”

That’s it. Now that code is saved off by itself in a php document. Let’s use it.

I make a new page called, “mymainpage.php.” Most likely, this would be actually called, “index.php” or sammy.php, or contact.php, whatever you would call a page.

Now, here is my new php page code.

Instead of

<div header>

bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,bla, bla, bla, bla, bla.
Links, video, more links, video, flash, more links, words images,,,,slide show,,,,

</div><!–Close the header here–>

in my header on 900 pages, I put in

include:“myheader.php”.

That’s it. And I do this in all of my 900 pages. Then next week, when I need to add one new link or one new image into the header, I just open, myheader.php, make the changes and upload that to the server, and it makes changes everywhere in my site.

Is that damn easy or what.

The thing is, imagine doing this for you left side menu bar, your footer menu and copyright situations, and maybe whatever else you might think of. That’s what WordPress is. I guess that’s why it’s free.

Now, if you visit my main web site, sillybilly.com, that is a totally html, css site. It have about 500 lines of html on each page backed up by about 4,000 lines of CSS to control the site.

I have a children s section that had been greatly neglected for years. I new that I wanted to put it up, and I had been procrastinating with my php, so I figured that I would give it a shot in my children’s section rebuild.

You can view that rebuild at http://www.sillybilly.com/creative/

If you look at sillybilly.com and sillybilly.com/creative side by side, you can’t tell what the difference is.

I tell you what, with the children’s section, I feel like a FREE Man. I can change stuff throughout the site without any worries, and if I change my mind, I can change it all again. I truly love it.

Moving Your site from html to Php.

What about SEO and your old pages.

That is exactly what I was worrying about. What would happen to my home page Google Stats and all the pages that I had taken years to build and grow and create great standing with Google. I found out about the “301 redirect” code. It is very simple and it worked like a charm. You take your old home page, or what ever page, and you get rid of everything in the page that redirects to your new php page.
Surprisingly, it’s happens and works the minute you upload the redirect page to the server.

The 301 redirect code is called a permanent redirect. That is because it permanently redirects the old page to the new php page. I had no problems with my Google rankings.

So there Ya go. I might not move my entire site to php today, or this week, but by this time next year, I’ll be all php, and I’ll be more in control of my site than if I were using WordPress, and the hackers won’t pay any attention to me because I’m not millions of people.

It’s easy, it’s powerful, it re leaves a lot of stress. If you have someone else that is building your site, or working on your site, ask them about their php skills. Be sure that they build your site in php. You don’t want a static html site. Remember, if your web person does not know php, then when you ask them to change that one link on 900 pages, that will take them about 20 hours. With php, it takes about 20 SECONDS.