This weeks project is to build a selector to select one of your classmates by name and display a link to their webpage.
first we’ll learn about php variables and arrays;
Next we’ll learn about php forms (you can also use forms in html but it’s simpler to build the form completely in php.
Step 1: create a file named ‘friends.php’.
Step 2: create a form handler file named ‘friendfinder.php’.
Step 3: Build a form method in friends.php. The code looks like this;
<form action=”friendfinder.php” method=”post”>
Name: <input type=”text” name=”name”><br>
Make up silly but NICE names for your classmates like; Sleepy, Goofy, Sneezy, etc.
Note: there’s no php in this file at this point but we’ll put some in later.
Step 4: Now build an array in friendfinder.php