Here is the code of the form:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>GYTA update</title>
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Cabin:700">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=ABeeZee&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Aclonica&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Acme&display=swap">
<link rel="stylesheet" href="assets/fonts/font-awesome.min.css">
<link rel="stylesheet" href="assets/fonts/ionicons.min.css">
<link rel="stylesheet" href="assets/css/Contact-Form-Clean.css">
<link rel="stylesheet" href="assets/css/Footer-Clean.css">
<link rel="stylesheet" href="assets/css/Footer-Dark.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/6.4.8/swiper-bundle.min.css">
<link rel="stylesheet" href="assets/css/Simple-Slider.css">
<link rel="stylesheet" href="assets/css/contact.css">
</head>
<body style="background: white;">
<header style="text-align: center;margin-top: 0px;background:rgb(255,208,164);padding: 0px;padding-top: 5px;">
<div style="padding-top: 7px;">
<h5 style="color: rgb(0,0,0);margin-bottom: 2px;font-family: Aclonica, sans-serif;">CONTACT</h5>
</div>
<div style="text-align: left;font-family: Lora, serif;">
<p style="color: rgb(0,0,0);margin-bottom: -3px;padding-left: 35px;padding-top: 3px;text-align: left;">Hotline: <a style="color: blue; text-decoration: none;" href="tel:676937382">(237) 676-937-382 /698-380-190</a></p>
<p style="color: rgb(0,0,0);padding-left: 35px;margin-bottom: 0px;">Email Us: <a style="color: blue; text-decoration: none;" href="mailto:info@gytaafrica.org">info@gytaafrica.org</a></p>
</div>
</header>
<section class="d-sm-flex justify-content-center justify-content-sm-center">
<div class="row" style="width: 365px;">
<div class="col" style="padding-top: 22px;padding-bottom: 15px;">
<!-- Start: form -->
<div class="container">
<form action="mail.php" method="post">
<label for="fname">First Name</label>
<input type="text" id="fname" name="firstname" placeholder="Your name..">
<label for="lname">Last Name</label>
<input type="text" id="lname" name="lastname" placeholder="Your last name..">
<label for="contact">Phone Number</label>
<input type="text" id="contact" name="contact" placeholder="Enter your phone number...">
<label for="email">Email</label>
<input type="text" id="contact" name="email" placeholder="Enter your email...">
<label for="message">message</label>
<textarea id="subject" name="subject" placeholder="Leave us a message.." style="height:200px"></textarea>
<input type="submit" value="Submit">
</form>
</div><!-- End: form -->
</div>
</div>
</section>
<canvas style="background-color: rgb(255,208,164);bottom: -50px;position: relative; height: 230px; width: 100%;border-right: 2px solid black; border-left: 2px solid black;" id="mycanvas"></canvas>
</body>
</html>
And here is the php code:
<?php
//getting data from php form
$fname = $POST['fname'];
$lname = $POST['lname'];
$contact = $POST['contact'];
$email= $POST['email'];
$message= $_POST['message'];
$to = "kueteleviscm157@gmail.com";
$subject = "Mail From website";
$txt ="First Name = ". $fname . "\r\n Last Name= " . $lname ."\r\n Contact= " . $contact . "\r\n Email = " . $email . "\r\n Message =" . $message;
$headers = "From: noreply@kueteleviscm157@gmail.com" . "\r\n" .
"CC: somebodyelse@example.com";
if($email!=NULL){
mail($to,$subject,$txt,$headers);
}
//redirect to thank you page
header("Location:thankyou.html");
?>