-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontact.php
More file actions
33 lines (22 loc) · 759 Bytes
/
Copy pathcontact.php
File metadata and controls
33 lines (22 loc) · 759 Bytes
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
<?php
$connection = mysqli_connect("localhost","root","","platform");
$database = mysqli_select_db($connection,"platform");
$username = $email = $msg = $errormsg = "";
if(isset($_POST["submit"])){
if(empty($_POST["uname"]) || empty($_POST["umail"]) || empty($_POST["msg"])){
echo "<script>alert('empty fields');</script>";
}
$username = $_POST["uname"];
$email = $_POST["umail"];
$msg = $_POST["msg"];
$sql = "INSERT INTO contact_table (name,email,message) VALUES ('$username','$email','$msg')";
$query = mysqli_query($connection,$sql);
if($query){
echo "<script>alert('data sent successfully');</script>";
header("location: indexplatform.php");
}
else{
echo "<script>alert('data not sent');</script>";
}
}
?>