Skip to content

Instantly share code, notes, and snippets.

@MarkyC
Created December 16, 2012 22:35
Show Gist options
  • Select an option

  • Save MarkyC/4313770 to your computer and use it in GitHub Desktop.

Select an option

Save MarkyC/4313770 to your computer and use it in GitHub Desktop.
<html>
<body>
<form <!-- This specifies a form HTML element: https://developer.mozilla.org/en-US/docs/HTML/Element/form -->
action="formProcessor.php" <!-- path to a script that processes the form -->
method="post"> <!-- general rule: POST sends data, GET gets data. Forms send data -->
<label> <!-- A label element /labels/ the input element -->
Enter Your Text Here:
<input <!-- input HTML element: https://developer.mozilla.org/en-US/docs/HTML/Element/input -->
name="myInput" <!-- The name of the input, used by formProcessor.php to retrieve the text from the input -->
type="text"> <!-- An input of type text is a single line textfield -->
</label>
<input type="submit"> <!-- We need a submit button to submit the form! -->
</form>
</body>
</html>
## formProcessor.php [php]
<html>
<body>
<h1>
You entered: <?php echo $_POST['myInput'] ?>
</h1>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment