You are on page 1of 4

lectures/1/src/google.

html
1.
2. <!DOCTYPE html>
3.
4. <html>
5.
<head>
6.
<title>Registration</title>
7.
</head>
8.
<body>
9.
<div style="text-align: center">
10.
<h1>Registration</h1>
11.
<form action="register.php" method="get">
12.
Name: <input name="name" type="text">
13.
<br>
14.
Gender: <input name="gender" type="radio" value="M">M <input name="gender" type="radio" value="F">F
15.
<br>
16.
<select name="state">
17.
<option value="CT">CT</option>
18.
<option value="MA">MA</option>
19.
</select>
20.
</form>
21.
</div>
22.
</body>
23. </html>

lectures/1/src/register.html
1.
2. <!DOCTYPE html>
3.
4. <html>
5.
<head>
6.
<title>Registration</title>
7.
</head>
8.
<body>
9.
<div style="text-align: center">
10.
<h1>Registration</h1>
11.
<form action="register.php" method="get">
12.
Name: <input name="name" type="text">
13.
<br>
14.
Gender: <input name="gender" type="radio" value="M">M <input name="gender" type="radio" value="F">F
15.
<br>
16.
<select name="state">
17.
<option value="CT">CT</option>
18.
<option value="MA">MA</option>
19.
</select>
20.
<br>
21.
<input type="submit" value="Register!!!">
22.
</form>
23.
</div>
24.
</body>
25. </html>

lectures/1/src/register.php
1.
2. <!DOCTYPE html>
3.
4. <html>
5.
<head>
6.
<title>Registered!</title>
7.
</head>
8.
<body>
9.
<h1>Hello, <?= htmlspecialchars($_GET['name']) ?>!</h1>
10.
<h1>You are a <?= htmlspecialchars($_GET['gender']) ?></h1>
11.
<h1>You are from <?= htmlspecialchars($_GET['state']) ?></h1>
12.
</body>
13. </html>

lectures/1/src/server.php
1. <!DOCTYPE html>
2.
3. <html>
4.
<head>
5.
<title>Google</title>
6.
</head>
7.
<body>
8.
<h1>You wanted to search for: <b><? print($_GET['q']) ?></b></h1>
9.
</body>
10. </html>

You might also like