Skip to main content

Responsive Contact Form and send data to email by php

Responsive Contact form with php validation and transfer data to email script


Responsive Contact form with php validation and transfer data to email script


Source : don't forget one think this will saved by filename.php extension its mandatory and its working online and linux based server platform.



<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="jumbotron text-center">
  <h2>Contact form with PHP ans send data to email</h2>
  <p>when you filling up the form and press send button the message will send the selected email id and show on your email's inbox</p>
</div>

<div class="container">
  <div class="col-lg-12">
    <form class="form" method="post" action="?"> <label>Name</label> <input type="text" class="form-control" placeholder="Name" name="name">
<br>
<label>Contact Number</label> <input type="text" class="form-control" placeholder="Contact Number" name="number">
<br>
<label>Email ID</label> <input type="text" class="form-control" placeholder="Email ID" name="email">
<br>
<label>Your Message</label> <textarea type="text" class="form-control" placeholder="Message" rows="5" name="msg"></textarea>
<br>
  <input type="submit" name="send" class="btn btn-primary" value="send">
  <button type="reset" class="btn btn-primary">Reset</button>
  <br>
</form>
<?php
if(isset($_POST['send']))
{
$use_name = $_POST['name'];
$use_number = $_POST['number'];
$use_email = $_POST['email'];
$use_message = $_POST['msg'];

echo "
<div class='alert alert-success'>
  <strong>Success!</strong> Indicates a successful or positive action.
</div>
";
$to = "viewnoor@gmail.com";
$subject = "Inquiry person $use_name";
$message = "
<html>
<head>
<title>Inquiry person $use_name</title>
</head>
<body>
<font face='arial'>
<table class='deco' width='100%' cellpadding='10' cellspacing='0' border='1' bordercolor='#555'>
<caption></caption>
  <tr bgcolor='#555555'>
<th colspan='2'>
<font color='white'>
Contact Informations
</font>
</th>
  </tr>
  <tr>
<th align='right' width='50%'>Name</th>
<td>$use_name</td>
  </tr>
  <tr>
<th align='right'>Contact Number</th>
<td>$use_number</td>
  </tr>
  <tr>
<th align='right'>E-mail</th>
<td><a href='mailto:$use_email'>$use_email</a></td>
  </tr>

  <tr>
<th align='right' valign='top'>Message</th>
<td>$use_message</td>
  </tr>
</table>
  <p align='center'><font size='1'>Thank you for for your wonderfull copuration with our service</font></p>
<div style='background:#070;
color:#DDD; width:200px; margin:auto;
text-align:center; padding:10px;'>Thank you</div>
</font>
</body>
</html>
";
}
?>
  </div>
</div>



</body>
</html>

Comments

Popular posts from this blog

How to Create a secure login panel with PHP & Mysql using parameters and session

Secure Login with PHP & Mysql Download project zip Requirement: you need an Apache and MySQL Server database on your device If your computer has xampp or wamp or mamp  or lamp that's great otherwise you need to install Apache and MySQL server Create a database login Run this query : CREATE TABLE admin ( id INT(6) AUTO_INCREMENT PRIMARY KEY, uname VARCHAR(30) NOT NULL, upass VARCHAR(30) NOT NULL ); INSERT INTO `admin` (`id`, `uname`, `upass`) VALUES (NULL, 'admin', 'admin1993'); That means you set your username =  admin and password = admin1993 Login Page: login.php <!doctype html> <html> <head> <meta charset="utf-8"> <title>Login Getway</title> <link rel="stylesheet" href="http://fontawesome.io/assets/font-awesome/css/font-awesome.css" type="text/css"> <style> * { margin:0px; padding:0px; font-family:ar...

Windows all version product key free

Product key for window vista : Vista | Ultimate | Acer | 3YDB8-YY3P4-G7FCW-GJMPG-VK48C Vista | Ultimate | Advent | 39MVW-K8KKQ-BGJ9B-24PMW-RYQMV Vista | Ultimate | Alienware | 7QVFM-MF2DT-WXJ62-XTYX3-P9YTT Vista | Ultimate | Asus | 6F2D7-2PCG6-YQQTB-FWK9V-932CC Vista | Ultimate | Dell | 2QBP3-289MF-9364X-37XGX-24W6P Vista | Ultimate | DixonsXP | 6JPQR-4G364-2B7P7-83FXW-DR8QC Vista | Ultimate | Gateway | 6P8XK-GDDTB-X9PJQ-PYF36-G8WGV Vista | Ultimate | Hedy | 7R2C3-DWCBG-C8G96-MPT8T-K37C7 Vista | Ultimate | HP | 23CM9-P7MYR-VFWRT-JGH7R-R933G Vista | Ultimate | Lenovo | 24J6Q-YJJBG-V4K4Q-2J8HY-8HBQQ Vista | Ultimate | OQO | C4QGV-XHYYT-9PW8R-DCFTQ-FBD6M Vista | Ultimate | Toshiba | 33G3W-JY3XQ-CQQ7C-TG96R-R6J6Q Vista | Ultimate | Sony | 2KKTK-YGJKV-3WMRR-3MDQW-TJP47 Vista | Ultimate | Stone | GVV4P-RQXD7-X9XKB-M2G9H-C93VM Vista | Ultimate | Velocity Micro | 9BKKK-7Y888-MHD67-HHXTB-332K9 Vista | Business | Acer | 2TJTJ-C72D7-7BCYH-FV3HT-JGD4F Vista | Bus...

MYSQLI DELETE table data using Parameters Prepared Statements (PHP)

Select and delete data from MySQL table using PHP help of  Parameters Prepared Statements. The output will be this. Source of  the Main page: <?php @$conn = mysqli_connect('localhost','root','','testdb') or die("Please check your database username and password") ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Insert into table</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <style> #myform { margin:20px; -webkit-box-shadow: 0px ...