getTUserId(); }else{ $author= Ticket_User::constr_ExternId($_POST['target_id'], $cfg['db']['lib'])->getTUserId(); } $ticket = new Ticket($cfg['db']['lib']); $ticket->setTicket($title,0,0,$category,$author); $ticket->create(); }else{ //ERROR: permission denied! $_SESSION['error_code'] = "403"; header("Location: index.php?page=error"); exit; } }else{ //ERROR: The form was not filled in correclty header("Location: index.php?page=settings"); exit; } }else{ //ERROR: user is not logged in header("Location: index.php"); exit; } }catch (PDOException $e) { //go to error page or something, because can't access website db print_r($e); exit; } }