-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontact.php
More file actions
95 lines (79 loc) · 2.51 KB
/
Copy pathcontact.php
File metadata and controls
95 lines (79 loc) · 2.51 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
<?php
include 'database.php';
$email;
$password;
if($_SERVER["REQUEST_METHOD"] == "POST")
{
$pdo = db_connect();
$name=$_POST['name'];
$email=$_POST['email'];
$text=$_POST['text'];
$query="INSERT INTO `contact` ( `email`, `name`, `message`) VALUES ( '$name', '$email', '$text')";
$result = $pdo->query($query);
if(isset($result))
{
echo "<script>alert('".$email." Message is Sent thanks for contacting!!')</script>";
}
else
{
echo "<script>alert('".$email." Oops your message couldnot be delivered')</script>";
};
};
?>
<html>
<head>
<title>Contact</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.26/jquery.form-validator.min.js"></script>
<link href="styleLog.css" rel="stylesheet" type="text/css">
<script src="main.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript">
$(document).ready(function(){
// WILL PREVENT FORM FROM SENDING IF THERE ARE ERRORS (comment this out to test PHP validation.)
$.validate();
});
</script>
</head>
<body >
<header class="stickyNav sticky">
<span><a href="#top" class="icon-circle-up"></span>
<div class="row">
<a class="logo" href="index.php">COPY-Paste</a>
<nav>
<ul>
<li><a href="about.php">About</a></li>
<li><a href="document.php">Documentation</a></li>
<li><a href="contact.php">Contact</a></li>
<li><a href="login.php" id="login">Login</a></li>
<li><a href="Register.php">Sign Up</a></li>
</ul>
</nav>
</div> <!-- / row -->
</header>
<div id="Sign-Up">
<form method="POST" action="contact.php" >
<div class="container">
<h1>Contact</h1>
<p>Thanks For Contacting us.</p>
<br>
<div>
<label for="name" ><b>Name</b></label>
<input type="text" id="name" placeholder="Enter Name" name="name" >
</div>
<div>
<label for="email" ><b>Email</b></label>
<input type="email" id="email" placeholder="Enter Email" name="email" required data-validation="email" >
</div>
<div>
<br>
<label><b>Your message goes here</b></label><br>
<textarea value="Your message goes here" rows="6" cols="40" name='text'></textarea>
</div>
<input type="submit" name="sumbit" value="Send">
</div>
</div>
</form>
</div>
</body>
</html>