PHP: Récupérer IP visiteur sans utiliser “exec”PHP: Récupérer IP visiteur sans utiliser “exec”

function getUserIP() { if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) { $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"]; $_SERVER['HTTP_CLIENT_IP'] = $_SERVER["HTTP_CF_CONNECTING_IP"]; } $client = @$_SERVER['HTTP_CLIENT_IP']; $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; $remote = $_SERVER['REMOTE_ADDR']; if(filter_var($client, FILTER_VALIDATE_IP)) { $ip = $client; } elseif(filter_var($forward,

PHP : fonctions perso pour DB MysqlPHP : fonctions perso pour DB Mysql

// ——————————————————————– Variables DATABASE ——————————————————————– define(“SOURCES”, array(“smtreport” => array(“host” => “serveurQuiContientMaDB1”,“user” => “monUserDB”,“pwd” => monPasswordDeDB,“schema” => “nomDeSchema1”),“exploit” => array(“host” => “serveurQuiContientMaDB2”,“user” => “monUserDB”,“pwd” => monPasswordDeDB,“schema” => “nomDeSchema2”)));   // ——————————————————————–

PHP : convertir date 2018-08-03T15:21:28+00:00 (exemple) pour insertion dans DB Mysql (datetime)PHP : convertir date 2018-08-03T15:21:28+00:00 (exemple) pour insertion dans DB Mysql (datetime)

// 2018-08-03T15:21:28+00:00$date = date_create_from_format(‘Y-m-d\TH:i:sT‘, ‘ 2018-08-03T15:21:28+00:00 ‘);echo date_format($date, ‘Y-m-d H:i:s‘);   Le format mysql est bien Y-m-d H:i:s pour le type datetime /