Skip to content

Instantly share code, notes, and snippets.

@LocalCommit
Created April 8, 2015 13:25
Show Gist options
  • Save LocalCommit/304ae0975cfc14eae929 to your computer and use it in GitHub Desktop.
Save LocalCommit/304ae0975cfc14eae929 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 = $_POST['firstname'];
$lastName = $_POST['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