-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscribenew.php
108 lines (97 loc) · 2.41 KB
/
scribenew.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
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
108
<!DOCTYPE html>
<html>
<head>
<title>Update your profile</title>
<style>
input[type=text], select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type=password], select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type=submit] {
width: 100%;
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #45a049;
}
div {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}
body {
background-image: url('ieye.png');
background-repeat: no-repeat;
background-attachment: fixed;
}
</style>
</head>
<body >
<h2 align="center">Update your profile</h2>
<form align="center" method="post">
</br>
Languages known: <input type="checkbox" name="check" value="english"> English
<input type="checkbox" name="check" value="telugu"> Telugu</br></br>
Qualification: <input list="qual" name="qual">
<datalist id="qual">
<option value="SSC">
<option value="Intermediate 1st year">
<option value="Intermediate 2nd year">
<option value="Graduation">
</datalist> </br></br>
Email id: <input type="text" name="emailid">
Address : <input type="text" name="address" >
<input type="submit" align="center" name="Update" value="Update" ></br>
</form>
<?php
session_start();
$servername = "localhost";
$username = "root";
$password = "";
// Create connection
$conn = mysqli_connect($servername, $username, $password,"cfg2");
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
$lang =$quali=$email=$address="";
if (isset($_POST["Update"])) {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$lang = $_POST["check"];
$quali =$_POST["qual"];
$email=$_POST["emailid"];
$address= $_POST["address"];
// check if name only contains letters and whitespace
}
}
$sql = "INSERT INTO scribeup2 (lang, qual,email,address) VALUES ('$lang', '$quali','$email','$address')";
if (mysqli_query($conn, $sql)) {
echo "New record created successfully";
} else {
echo "Error: " ;
}
echo "Msg is " . $_SESSION["msg"] . ".<br>";
?>
</body>
</html>