Skip to content

Instantly share code, notes, and snippets.

@LocalCommit
Created April 8, 2015 13:29
Show Gist options
  • Save LocalCommit/58aecec6be08ed7f66f1 to your computer and use it in GitHub Desktop.
Save LocalCommit/58aecec6be08ed7f66f1 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="name.php" method="post">
<div><label for="firstname">First name:
<input type="text" name="firstname" id="firstname"></label>
</div>
<div><label for="lastname">Last name:
<input type="text" name="lastname" id="lastname"></label>
</div>
<div><input type="submit" value="GO"></div>
</form>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Form Example</title>
</head>
<body>
<p>
<?php
$firstName = $_REQUEST['firstname'];
$lastName = $_REQUEST['lastname'];
echo 'Welcome to our website, ' .
htmlspecialchars($firstName, ENT_QUOTES, 'UTF-8') . ' ' .
htmlspecialchars($lastName, ENT_QUOTES, 'UTF-8') . '!';
?>
</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment