Created
March 16, 2019 14:39
-
-
Save simoebenhida/9396eaa474a9f9098ded6d7d76c0826c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if( | |
!empty($_POST) | |
&& !empty($_POST['firstName']) | |
&& ! empty($_POST['lastName']) | |
&& ! empty($_POST['message']) | |
) { | |
echo "Your Form has been successfully Sent!"; | |
} | |
?> | |
<form style="display: flex;flex-direction: column;width:400px" action="" method="POST"> | |
<div style="margin-bottom: 10px"> | |
<input type="text" name="firstName" placeholder="first name" value="<?php echo $_POST['firstName'] ?? ''; ?>"> | |
<?php | |
if(! empty($_POST) && empty($_POST['firstName'])) { | |
echo "</br><span style='color:red;font-style:italic'>first Name is required!</span>"; | |
} | |
?> | |
</div> | |
<div style="margin-bottom: 10px"> | |
<input type="text" name="lastName" placeholder="last name" value="<?php echo $_POST['lastName'] ?? ''; ?>"> | |
<?php | |
if(! empty($_POST) && empty($_POST['lastName'])) { | |
echo "</br><span style='color:red;font-style:italic'>last Name is required!</span>"; | |
} | |
?> | |
</div> | |
<div style="margin-bottom: 10px"> | |
<textarea name="message" id="" cols="30" rows="10" placeholder="Message"><?php echo $_POST['message'] ?? ''; ?></textarea> | |
<?php | |
if(! empty($_POST) && empty($_POST['message'])) { | |
echo "</br><span style='color:red;font-style:italic'>Message is required!</span>"; | |
} | |
?> | |
</div> | |
<button style="padding-top: 10px;padding-bottom: 10px" type="submit">Send !</button> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment