Skip to content

Instantly share code, notes, and snippets.

@LocalCommit
Last active August 29, 2015 14:18
Show Gist options
  • Save LocalCommit/7734a3d3b7003175f437 to your computer and use it in GitHub Desktop.
Save LocalCommit/7734a3d3b7003175f437 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Form Example</title>
</head>
<body>
<form action="" method="post">
<div><label for="firstname">Enter ID:
<input type="text" name="id" id="firstname"></label>
</div>
<div><input type="submit" value="GO"></div>
</form>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Goodby Message Example</title>
</head>
<body>
<p>
<?php echo $output; ?>
</p>
</body>
</html>
<?php
if (!isset($_REQUEST['id']))
{
include 'form.html.php';
}
else
{
$id = $_REQUEST['id'];
if ($id == 'welcome')
{
$output = "Welcome controller.";
include 'welcome.html.php';
}
else
{
$output = 'Goodby controller.';
include 'goodby.html.php';
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Welcome Message Example</title>
</head>
<body>
<p>
<?php echo $output; ?>
</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment