Skip to content

Instantly share code, notes, and snippets.

Created November 15, 2020 16:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save alfintechcomputer/b11f1c12c5b68e61862f3064065bced6 to your computer and use it in GitHub Desktop.
HTML Forms using PHP
if(isset($_POST['submit']) and strlen($_POST['website']) > 0) {
$website = htmlspecialchars($_POST['website']);
$category = htmlspecialchars($_POST['category']);
echo "Hi bud, thanks for submitting <b>$website</b> to the <b>$category</b> category.";
} else {
echo 'Enter a Website and Category';
<meta charset="utf-8">
<title>HTML Form Built With Love</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/respond.js"></script>
<script src=""></script>
<script src="js/bootstrap.min.js"></script>
<form action="htmlformbuiltwithlove.php" method="post">
Website: <input type="text" name="website" value="" /><br>
Category: <input type="text" name="category" value="" /><br><br>
<input type="submit" name="submit" value="Submit Website" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment