HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP - Creating a Website


Learn PHP by building a web site from scratch.

Part I: Creating a Web Site.


Create a Website

Create an empty PHP web site named DemoPHP.

If you want to learn how to create an empty web site, please go to the chapter Web Empty Site.


Create a Home Page

In the "DemoPHP" folder, create a new PHP file named Index.php.

Put the following content inside the file:

Index.php

<!DOCTYPE html>

<html>
<head>
  <title>PHP Demo</title>
</head>

<body>
  <h1>Welcome to W3Schools</h1>
  <h2>Web Site Main Ingredients</h2>
  <p>A Home Page (Index.php)</p>
  <p>A Style Sheet (Site.css)</p>
  <p>Include files (Header.php, Footer.php)</p>
</body>

</html>

Run example »


Add an About Page

In the "DemoPHP" folder, create a new PHP file named "About.php".

Put the following code inside the file:

About.php

<!DOCTYPE html>

<html>
<head>
  <title>About</title>
</head>

<body>
<h1>About Us</h1>
<p>Lorem Ipsum Porem Lorem Ipsum Porem</p>
</body>

</html>

The about file above contains a heading and a paragraph. Please feel free to edit the content.

In the next chapters of this demo, we will add a style sheet to the web site, then we will add a database, and finally we will add navigation.



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE