-
Notifications
You must be signed in to change notification settings - Fork 0
/
process_contact.php
53 lines (41 loc) · 921 Bytes
/
process_contact.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
require('includes/config.php');
if(!empty($_POST))
{
$msg=array();
if(empty($_POST['nm']) || empty($_POST['email']) || empty($_POST['query']))
{
$msg[]="Please full fill all requirement";
}
if(is_numeric($_POST['fnm']))
{
$msg[]="Name must be in String Format...";
}
if(is_numeric($_POST['email'])) //See this validation for @,21212 Later
{
$msg[]="Name must be in appropriate Format...";
}
if(!empty($msg))
{
echo '<b>Error:-</b><br>';
foreach($msg as $k)
{
echo '<li>'.$k;
}
}
else
{
$nm=$_POST['nm'];
$email=$_POST['email'];
$question=$_POST['query'];
$query="insert into contact(con_nm,con_email,con_query)
values('$nm','$email','$question')";
mysqli_query($conn,$query) or die("Can't Execute Query...");
header("location:contact.php");
}
}
else
{
header("location:index.php");
}
?>