-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontact.php
More file actions
107 lines (105 loc) · 3.33 KB
/
Copy pathcontact.php
File metadata and controls
107 lines (105 loc) · 3.33 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Contact</title>
</head>
<?php
include"menu.php";
$sql=mysqli_query($conn,"select * from contact where id='1' ");
$f=mysqli_fetch_assoc($sql);
?>
<script>
var a="c";
</script>
<body onload="changecolor(a)">
<h6 class="text-center text-uppercse da pb-3">
Tell me about you
</h6>
<div class="container">
<div class="row">
<div class="col-lg-3"></div>
<div class="col-md-12 col-lg-7 text-center">
<div class="card">
<form action="contact.php" method="post" onsubmit="handlesubmit(this)">
<p class="text-uppercase">
hi, my name is
</p>
<p>
<input type="text" class="form-control" placeholder="name" name="name">
</p>
<p class="text-uppercase">
i am from
</p>
<p><input type="text" class="form-control" placeholder="city" name="city"></p>
<p class="text-uppercase">i am planning</p>
<p><input type="text" class="form-control" placeholder="ceremony type" name="type"></p>
<p class="text-uppercase">with budget for phothography</p>
<p><input type="number" class="form-control" min="100" placeholder="4000" name="money" value="4000"></p>
<p class="text-uppercase">
OK,give your number number or Email
</p>
<p><input type="text" class="form-control" placeholder="Email or phone" name="phone"></p>
<button class="btn bg-warning text-white d-block float-right" type="submit" name="sy" >submit </button>
<?php
if (isset($_POST['sy'])) {
$name=isset($_POST['name'])? $_POST['name']:null;
$city=isset($_POST['city'])? $_POST['city']:null;
$type=isset($_POST['type'])? $_POST['type']:null;
$money=isset($_POST['money'])? $_POST['money']:null;
$phone=isset($_POST['phone'])? $_POST['phone']:null;
if ($name==null) {
# code...
echo "<font color=red>please tell me your name </font>";
}
elseif ($city==null) {
# code...
echo "<font color=red>please tell me your city </font>";
}
elseif ($type==null) {
# code...
echo "<font color=red>please tell me what type of ceremony you planned </font>";
}
elseif ($phone==null) {
# code...
echo "<font color=red>please give me your phone or email </font>";
}
else{
$insert=mysqli_query($conn,"insert into customer(name,city,type,budget,phone) values ('$name','$city','$type','$money','$phone')");
if($insert!=0){
echo "<script>window.alert('Thank you for being friend i will contact you soon')</script>";
echo "<script>location.href='contact.php'</script>";
}
else{
echo "Error: " . $insert . "<br>" . $conn->error;
}
}
}
?>
</form>
</div>
</div>
</div>
</div>
<h4 class="text-center text-uppercase my-3"> Or contact me</h4>
<div class="container">
<div class="row">
<div class="col-lg-3"></div>
<div class="col-md-12 col-lg-7 text-center justify-content-around">
<a href="<?php echo $f['gmail']; ?>"><i class="fab fa-google fa-2x text-danger my-2"></i> Gmail </a><br>
<a href="<?php echo $f['whatsup']; ?>"><i class="fab fa-whatsapp fa-2x text-success my-2"></i> Whatsapp</a><br>
<a href="<?php echo $f['messenger']?>"><i class="fab fa-facebook-messenger fa-2x text-primary my-2"></i> Messenger</a><br>
<a href="<?php echo $f['viber']; ?>"><i class="fab fa-viber fa-2x text-primary my-2"></i>Viber</a>
</div>
</div>
</div>
<script>
function handlesubmit(e){
e.preventDefault();
}
</script>
<?php
include"footer.php";
?>
</body>
</html>