I have created forms under tabs to collect either story, poem and author or words of encouragement from a user and use the mail() to send the data to my email but it's not working have a look at my code.
<div id="Story" class="tabcontent">
<form action="done.php" method="POST">
<input type="hidden" name="category" value="story">
<input type="hidden" name="story" value="word">
<textarea name="story" required="required" minlength="12" placeholder="Story" required="required"></textarea>
<br>
<div class="desc">maximum of 100 words</div>
<br>
<button type="submit" name="send" class="btn">send</button>
</form>
</div>
<div id="peom" class="tabcontent">
<form action="done.php" method="POST">
<input type="hidden" name="category" value="short peom">
<input type="hidden" name="peom" value="word">
<textarea name="peom" required="required" minlength="12" placeholder="short poem" required="required"></textarea>
<br>
<div class="field">
<input type="text" name="author" placeholder="author" required="required">
</div>
<div class="desc">maximum of 100 words</div>
<br>
<button type="submit" name="send" class="btn">send</button>
</form>
</div>
<div id="encouragement" class="tabcontent">
<form action="done.php" method="POST">
<input type="hidden" name="category" value="short word">
<input type="hidden" name="short" value="word">
<div class="field">
<input type="text" name="encouragement" placeholder="words of encouragement" required="required">
</div>
<div class="desc">maximum of 20 words</div>
<br>
<button type="submit" name="send" class="btn">send</button>
</form>
</div>
<!--
php.done file below
-->
done.
<?php
if(isset($_POST['submit'])){
$story = $_POST['story'];
$peom = $_POST['peom'];
$author = $_POST['author'];
$encouragement = $_POST['encouragement'];
$email_from = 'website123@gmail.com';
$email_subject = "creditentials";
$email_body = "story is; $story \n, peom is; $peom. and author is; $author \n, words of encouragement is; $encouragement ";
$to = "123@gmail.com";
$headers = "From: $email_from \r\n";
mail($to,$email_subject,$email_body,$headers);
}
?>