session_start(); ini_set('display_errors', 1); //header('Content-type: text/html; charset=UTF-8'); error_reporting(E_ALL); $dbhost = 'localhost'; $dbuser = 'redirect'; $dbpass = '1fnRQ9DX'; $db_name = 'redirect'; $dbConnect = mysqli_connect($dbhost, $dbuser, $dbpass,$db_name); if (!$dbConnect) { die('Could not connect: ' . mysql_error()); } $title = ''; $description = ''; $keyword = 'actualitees,people,program TV,information,cnn,nbc'; $links = array(); class main { function main() { $this->title = ''; $this->keyword = ''; $this->description = ''; $this->links = array(); $this->visites = 0; $this->lastvisite = ''; $this->redirect = ''; $this->add = isset($_GET['add'])?true:false; // $this->GetInfo( $_SERVER['HTTP_HOST'] ); } /* ----------------------------------- public function GetLst() ----------------------------------- */ public function GetLst( $where = '' ) { global $dbConnect; //tools::debug(''.__METHOD__." ( ".basename(__FILE__)." ligne ".__LINE__.')'); $sql = 'select * from sites '; if( $where != '') $sql.= ' WHERE ' . $where; $sql.= ' order by titre'; $result = mysqli_query($dbConnect, $sql); $lst = array(); while( $row = mysqli_fetch_array( $result ) ) { $lst[] = $row; } return $lst; } } $cMain = new main(); $title.= $cMain->title; $keyword.= $cMain->keyword; $description.= $cMain->description; $links = $cMain->GetLst(); ?>