Skip to content

Commit 286d465

Browse files
committed
2 parents caaa726 + 572a0ba commit 286d465

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

html/index.php

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,5 @@
11
<?php
22

3-
//phpinfo();
3+
phpinfo();
44

5-
$contents = file_get_contents( "../.env" );
6-
$lines = explode( "\n", $contents );
7-
foreach($lines as $line){
8-
$vars = explode( "=", $line );
9-
if ( $vars[0] == "DB_USER") $db_username = $vars[1];
10-
if ( $vars[0] == "DB_PASSWORD") $db_password = $vars[1];
11-
if ( $vars[0] == "DB_NAME") $db_name = $vars[1];
12-
}
13-
14-
$link = mysqli_connect( 'database:3306', $db_username, $db_password, $db_name );
15-
16-
//if connection is not successful you will see text error
17-
if ( !$link ) {
18-
die( 'Could not connect: ' . mysql_error() );
19-
}
20-
21-
//if connection is successfully you will see message below
22-
echo 'Connected successfully';
23-
echo "Host information: " . mysqli_get_host_info( $link ) . PHP_EOL;
24-
25-
mysqli_close( $link );
26-
27-
?>
5+
?>

0 commit comments

Comments
 (0)