Tutorial On How to Make a Quiz or Interactive Site, Page 2

Lost? Go back to the beginning.

Great, You're Still With Me

So what do we need? Simple HTML doesn't cut it. You need something to enhance HTML to make it do cool stuff. What you need is PHP. What's PHP? It's scripting code to mix into your HTML to make it do, well, cool stuff.

How Does PHP Work?

Well, it's easy. You have your HTML page as always (wait.. I hope you at least know a little HTML! If not, you'll have to get up to speed on that). But whenever you want to cut over to some PHP scripting you put a "<?php". And whenever you want to cut back over to the HTML, you put a "?>". Below shows what I mean.

<html>
<head>
<title>My Page</title>
</head>
<body>
<h1>Welcome to my page</h1>
<?php
//some php script goes here
?>

<p>Now we're back to HTML</p>
</body>
</html>

Instead of "//some php script goes here" you could have put something like: echo 'my first line of php script!';

"echo" is a PHP command that outputs text. So in this case, it would print the line "my first line of php script!" in between your h1 tag and your "Now we're back to HTML" paragraph. You should note, every line of PHP ends with a semi-colon and lines of text should be put inside either double or single quotes.

Okay, Let's Get On With It

Click to Page 3 to begin our simple example quiz.

Go To Page 3