Don't Miss

How to send data from HTML to PHP

By on January 23, 2018

index.html

<html>
<body>
<form action=”action.php” method=”post”>
<input required type=”text” name=”name” placeholder=”Name”><br/><br/>

<input required name=”email” type=”text” placeholder=”Your Email”><br/><br/>

<input required type=”text” placeholder=”Your Contact”><br/><br/>

<select name=”subject”>
<option>Select Subject</option>
<option>Select one</option>
<option>Select two</option>
</select><br/><br/>

<textarea name=”message” required cols=”10″ rows=”10″ placeholder=”Comments”></textarea><br/><br/>

<input type=”submit” value=”Get Contact”>

</form>
</body>
</html>

 

action.php

<?php

echo $name = $_POST[‘name’];
echo $email = $_POST[’email’];
echo $contact = $_POST[‘number’];
echo $subject = $_POST[‘subject’];
echo $message = $_POST[‘message’];

?>

About CodingBazz

Leave a Reply

Your email address will not be published. Required fields are marked *