-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.php
68 lines (35 loc) · 1.43 KB
/
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php include('header.php'); ?>
<?php include('Admin/function.php'); ?>
<!-- this is for donor registraton -->
<div class="contact" style="background-color: #7faf81;">
<h1 class="text-center">Contact us</h1>
<form enctype="multipart/form-data" method="post" class="text-center">
Name:<input type="text" name="t1" required="required" pattern="[a-zA-Z _]{2,15}" title="please enter only character between 2 to 15 for donor name" /> <br>
E-Mail</td><td><input type="email" name="t2" required="required" /> <br>
Mobile No</td><td><input type="number" name="t3" pattern="[0-9]{10,12}" title="please enter only numbers between 10 to 12 for mobile no." /> <br>
Subject</td><td><textarea name="t4"></textarea> <br>
<input type="submit" value="Send Us" name="sbmt">
</form>
</div>
<?php include('footer.php'); ?>
</div><!-- containerFluid Ends -->
<script src="js/bootstrap.min.js"></script>
<?php include('regivalidate.php'); ?>
<?php
if(isset($_POST["sbmt"]))
{
$cn=makeconnection();
$s="insert into contacts(name,email,mobile,subj) values('" . $_POST["t1"] ."','" . $_POST["t2"] . "','" . $_POST["t3"] . "','" . $_POST["t4"] ."')";
$q=mysqli_query($cn,$s);
mysqli_close($cn);
if($q>0)
{
echo "<script>alert('Record Save');</script>";
}
else
{echo "<script>alert('Saving Record Failed');</script>";
}
}
?>
</body>
</html>