Repository navigation
Expand file tree
/
Copy pathform.php
More file actions
69 lines (61 loc) · 2.42 KB
/
Copy pathform.php
File metadata and controls
69 lines (61 loc) · 2.42 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
<?php
if (isset($_POST['submit'])) {
if (isset($_POST['name']) && isset($_POST['email']) &&
isset($_POST['phonenumber']) && isset($_POST['type']) && isset($_POST['yearsofexperience']) && isset($_POST['bio']) && isset($_POST['twitter'])&&
isset($_POST['facebook']) && isset($_POST['instagram']) && isset($_POST['linkedin'])&& isset($_POST['previousexp'])) {
$username = $_POST['name'];
$email = $_POST['email'];
$phonenumber = $_POST['phonenumber'];
$type = $_POST['type'];
$yearsofexperience = $_POST['yearsofexperience'];
$bio = $_POST['bio'];
$twitter = $_POST['twitter'];
$facebook= $_POST['facebook'];
$instagram = $_POST['instagram'];
$linkedin = $_POST['linkedin'];
$previousexp = $_POST['previousexp'];
$host = "localhost";
$dbUsername = "root";
$dbPassword = "Nikitha@123";
$dbName = "arcade";
$conn = new mysqli($host, $dbUsername, $dbPassword, $dbName);
if ($conn->connect_error) {
die('Could not connect to the database.');
}
else {
// $Select = "SELECT email FROM from1 WHERE email = ? LIMIT 1";
$Insert = "INSERT INTO form1(name, email, phonenumber,type , yearsofexperience, bio, twitter, facebook, instagram, inkedin, previousexp) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
// $stmt = $conn->prepare($Select);
//$stmt->bind_param("s", $email);
// $stmt->execute();
//$stmt->bind_result($resultEmail);
//$stmt->store_result();
//$stmt->fetch();
//$rnum = $stmt->num_rows;
// if ($rnum == 0) {
//$stmt->close();
$stmt = $conn->prepare($Insert);
$stmt->bind_param("ssssssssss",$username, $email, $phonenumber, $type, $yearsofexperience, $bio, $twitter, $facebook, $instagram,$linkedin,$previousexp);
if ($stmt->execute()) {
echo "sucessfully created your profile";
}
else {
echo $stmt->error;
}
// }
// else {
// echo "Someone ha alredy used the email";
//}
$stmt->close();
$conn->close();
}
}
else {
echo "All field are required.";
die();
}
}
else {
echo "Submit button is not set";
}
?>