As Christmas approaches, people scatter stores to get last-minute gifts. So I decided to decrease your risk of being trampled by people richer than you by creating a "gift giver" you can use online. It also has an "exchange" feature so you can get rid of your coffee maker (that you already have two of) without leaving the warmth of home. Be careful, though. You never know what it's going to give.
This system uses three files and sessions. The first file is just a cover page. It only has text and a button to send you to the second page. The second page give you an initial gift and an "exchange" option. The third page gives you a second gift if you chose to on page two. I will not include any stylesheets.
Step 1: Index.php
Index.php is the file apache sends to a client when they visit a site. You can actually rename this file to "index.html", "home.html", "home.php", etc. Just remember to make the necessary changes later.
In the root directory of your web server (named "www"), create two folders called "gift1" and "gift2". These folders will have one file in them called "index.php". Unlike the "index.php" file we are about to create, these index files HAS to have the "php" extension.
In your root directory, create "index.php" and put in the following text, then save the file:
<!DOCTYPE HTML><html><title>gift giver</title><meta charset="UTF-8"></head>
<h1>The Gift Giver</h1>
<p>Hahaha. This page will give you a gift. It is simple. Just click "give me
a gift." It will. It is a small gift. But you have a chance to "exchange" it
for another gift. The exchange gifts will be bigger. However, it may not be
a good gift.</p>
<br /><br />
<form action="./gift1" method="post">
<!-- Gift? <input type="checkbox" name="gift" value="yes" /><br /> -->
<input type="submit" name="ubmit" value="Click here for your gift" />