Mise à jour de 'Sources/php_script/script/config.php'
continuous-integration/drone/push Build is passing Details

master
Dorian HODIN 2 years ago
parent da7fb93d90
commit ab1c306f5b

@ -8,18 +8,6 @@ function connection(): bool|int|mysqli
$password = $_ENV["PASSWORD"]; //Get the password for the user selected $password = $_ENV["PASSWORD"]; //Get the password for the user selected
$db_name = $_ENV["DATABASE"]; //Get the name of the database $db_name = $_ENV["DATABASE"]; //Get the name of the database
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
echo "AH";
echo $ip;
try { //Try to connect to the database try { //Try to connect to the database
return mysqli_connect($host, $username, $password,$db_name); //Connecting to database return mysqli_connect($host, $username, $password,$db_name); //Connecting to database
@ -31,5 +19,14 @@ function connection(): bool|int|mysqli
} }
} }
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
echo "AH";
echo $ip;

Loading…
Cancel
Save