0,'namn'=>'Gäst','admin'=>0); if (!empty($_COOKIE['m_id'])) { $q = "SELECT fotograf_id, namn, pass, admin FROM fotografer WHERE fotograf_id = '".mysql_real_escape_string($_COOKIE['m_id'])."' AND pass!=''"; $record = db_fetch($q); if ($record[0]['pass'] == $_COOKIE['pass']) { //echo "Inloggad som ".$record[0]['namn']."!"; $user = $record[0]; //$user['admin'] = 1; //TODO: sätt i db } } //Test //$user = array('admin'=>1, 'namn'=>'Göran Wik', 'fotograf_id'=>1); //TODO: sätt i db //Aktivera smarty $smarty = activate_smarty(); $smarty->assign('user', $user); function activate_smarty() { //Smarty för alla domäener på ett ställe, utom templates-katalogen! define('SMARTY_DIR','/home/konstpri/public_html/salongkalufsen.se/smarty/libs/'); require_once(SMARTY_DIR.'Smarty.class.php'); $smarty = new Smarty; $smarty->caching = false; $smarty->template_dir = '/home/konstpri/public_html/salongkalufsen.se/templates/'; $smarty->compile_dir = '/home/konstpri/public_html/salongkalufsen.se/smarty/templates_c/'; $smarty->config_dir = '/home/konstpri/public_html/salongkalufsen.se/smarty/configs/'; $smarty->cache_dir = '/home/konstpri/public_html/salongkalufsen.se/smarty/cache/'; return $smarty; } ?>
Fatal error: Uncaught Error: Call to undefined function db_fetch() in /home/konstpri/public_html/salongkalufsen.se/frisyrer.php:9 Stack trace: #0 {main} thrown in /home/konstpri/public_html/salongkalufsen.se/frisyrer.php on line 9