forked from digitalocean/sample-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp.php
More file actions
30 lines (28 loc) · 631 Bytes
/
php.php
File metadata and controls
30 lines (28 loc) · 631 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
<?php
$databaseHost = 'stu-do-user-14623249-0.b.db.ondigitalocean.com';
$databaseName = 'defaultdb';
$databaseUsername = 'doadmin';
$databasePassword = 'AVNS_c16XxROSTRMnvh_Ihto';
$con = mysqli_connect($databaseHost,$databaseUsername,$databasePassword,$databaseName);
if (isset($_POST['btn'])) {
if ($con) {
echo "Success";
}
else{
echo "Not Connected";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Welcome</title>
</head>
<body>
<form method="post">
<button type="submit" name="btn" >Check</button>
</form>
</body>
</html>