How do I Build a Website Using PHP?

PHP became wildly popular because of its shallow learning curve.

PHP, originally called Personal Home Page, was an HTML templating extension for the PERL computer programming language. PHP soon caught on in a big way because of its simple syntax inspired by the C programming language, and its ubiquity among open source Web servers used by most Internet Web hosts. Because of its origins as an HTML templating language, PHP makes it trivial (easy) to generate HTML, or to inject pieces of data into an existing HTML page.

Instructions

Difficulty: 5

Step 1

Change the extension of the HTML document in which you want to include PHP from .html to .php. For example, if your file is called index.html then you should change it to index.php.

Step 2

Open your new PHP file, then copy and paste the following code into the body of the document to display the text "Hello Joe, how are you?" as a header: <?php $name = "Joe"; printf("<h1>Hello %s, how are you?</h1>", $name); ?>

Step 3

Upload your PHP file to your Web server using your favorite FTP client for the upload.

Step 4

Navigate to the Web address you uploaded the file to in the previous step to see the code in action, displaying the message to "Joe."

Top Web Hosting Sites
Compare the Top Web Hosting providers. Free Setup, Free Domain Names.
www.superhostingdeals.com

Web Hosting Service
Build & Host a Website in Minutes. Try our Service Risk-free Now!
www.ipage.com

Top 10 Web Hosting - 2010
Reviews of the Top 10 Web Hosting Sites starting at $3.95/Month.
www.superhostingdeals.com

Cheap Domain Names
Best Value on Web - Free Features, Free Website Creator, Apps, More.
www.bulkregister.com

Top Ranked Web Hosting
Free Domain, Free Email, Risk-Free Guarantee.
stats.justhost.com


References


Tips & Warnings

  • You can mix PHP code and HTML as much you want. Sometimes PHP files will not display anything, but instead just process data, other times PHP files will be mostly HTML as in the steps above.

Article Written By L.P. Klages

L.P. Klages is an entrepreneur and software developer, concentrating on information theory, software user experience, and mathematical modeling. He has been writing about technology and the business of technology since 1999. His articles have appeared on many sites, including GameDev.net, KenSharpe.net, and eHow. Klages attended Jacksonville University in Jacksonville, Fla.


More Articles By L.P. Klages


Home | Privacy | Terms | About Us | Site Map | Recent Articles | † requires javascript
SuperHostingDeals.com, ratings are based on editorial review of each service provider.
A direct link to SuperHostingDeals.com is required in order to use any of the above information.

rapid ssl certificate

Copyright © 2010 SuperHostingDeals.com
Names, trademarks and logos are the properties of their
respective owners and protected by law