Convert HTML WebSite to PHP
From Static to Dynamic in a Few Short Minutes
In the modern Internet, dynamic websites are key to a successful business venture. the old static HTML just can't compare to what one needs. I had this old static site as my home page. I needed to pace some server-side srcipts in there to strut my skills. To do this the files needed to be converted from HTML (with a .html file extension) to PHP files. I did this with Gedit, a Linux text editor and my trusty old Linux shell. There are many ways to do it. There are many text editors for Linux, Windows, and Mac. A simple search on Google or Bing will give you a free one.
First, I opened a shell and went to the directory on my own machine where the files are stored and typed the following:
john@john-laptop:~$ cd Documents/WebDesignStuff
john@john-laptop:~/Documents/WebDesignStuff$ cd Dark_Metal
about.html contact.html index.html~ newsfeed.php~ webdesign.html
about.html~ contact.html~ linux.html scripts.html webdesign.html~
affilate.html images.html linux.html~ scripts.html~
affilate.html~ images.html~ newsfeed.html servo.swf
affiliate.html img newsfeed.html~ style.css
affiliate.html~ index.html newsfeed.php style.css~
john@john-laptop:~/Documents/WebDesignStuff/Dark_Metal$ mkdir PHP
john@john-laptop:~/Documents/WebDesignStuff/Dark_Metal$ cp about.html PHP/about.php
john@john-laptop:~/Documents/WebDesignStuff/Dark_Metal$ cp affiliate.html PHP/affiliate.php
john@john-laptop:~/Documents/WebDesignStuff/Dark_Metal$ cp contact.html PHP/contact.php
john@john-laptop:~/Documents/WebDesignStuff/Dark_Metal$ cp images.html PHP/images.php(etc., etc., The terminal output is too long and just too damn boring to print it all!)
After the html files had been copied into PHP in a different directory, I then opened good old Gedit text editor. I believe you can do the same thing with Windows Notepad. I opened all of the files in separate tabs, and did a "search and replace." I inserted the name of the old files ending with .html and replaced them with .php. I did this for every file name. It was that simple. I ran this over every one of the open tabs. This is because my internal navigation links were to the old HTML files instead of the PHP. I then opened my trusty FTP client Filezilla (works on Windows, Linux and Mac.) and opened "site manager." I opened that account, logged in, and deleted all of the HTML files in the site. Then I uploaded all of the PHP files. Bingo! It took the really slow server several minutes to load the new files, but it's working now.
More by this Author
In my research for common law remedies of which I wrote a hub about, I've come across a movement known as the Freeman-on-the-land. I hadn't heard the term in over a decade. It has been since I knew a fellow who had...
The full view of Hydrogen Good news is that it ships with many distributions like 64studio and Medibuntu. That means the live cd will run it, and you won't have to go through installing a new operating system just to...
An old traditional court of common law, though antiquated can still have modern uses. Is this dinosour still used? If so How? This is a brief look at one very complicated instrument of law revolving around the concept...
No comments yet.