'localhost', 'username' => 'root', 'password' => '', 'database' => 'screens', ); $id = isset($_GET['image']) ? $_GET['image'] : ''; if($id == '' ) { // redirect to gallery; do with .htaccess? $content = 'id not set'; } else { if(!is_numeric($id) || $id <= 0) { $content = 'This image does not exist: bad id format (' . $id . ')'; } else { $db = mysqli_init(); $db->real_connect($conf->hostname, $conf->username, $conf->password, $conf->database); $query = "SELECT extension, created FROM screens WHERE id = $id"; $result = $db->query($query); if($result->num_rows == 0) { $content = 'This image does not exist: not in database'; } else { // load tags $image = $result->fetch_object(); $content = ''; } } } ?>