所以问题被删除了,所以............。
你需要改变 GET
到 POST
这样
<?php
if(isset($_POST['submit'])){
if(empty($_POST['email'])){
echo 'An email is required <br />';
} else {
$email = $_GET['email'];
}
if(empty($_POST['title'])){
echo 'A title is required <br />';
} else {
$title = $_GET["title"];
}
if(empty($_POST['ingredients'])){
echo 'At least one ingredient is required <br />';
} else {
$ingredients = $_GET["ingredients"];
}
}
?>
<html>
<form action="index.php" method="POST" class="white">
<label> Your email:</label>
<input type="text" name="email">
<label> Pizza title:</label>
<input type="text" name="title">
<label> Ingredients</label>
<input type="text" name="ingredients">
<div class="center">
<input type="submit" name="submit" value="submit" class="btn brand z-depth-0">
</div>
</form>
</html>