-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path33.DbConnection.php
41 lines (31 loc) · 1020 Bytes
/
33.DbConnection.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
<?php
if(isset($_POST['submit'])) {
$userName = $_POST['username'];
$password = $_POST['password'];
$connection = mysqli_connect('localhost','root','','test');
if($connection) {
echo "DB Connection successfully Established";
}
else {
die("DB Connection could not be established<br/>".mysqli_connect_error($connection));
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<form action = "33.DbConnection.php" method="post">
<pre>
<input type="text" placeholder = "Enter username" name="username" />
<input type="password" placeholder = "Enter Passwrod" name="password" />
<input type="submit" value="Submit" name="submit"/>
</pre>
</form>
</body>
</html>