php fixes
parent
544d2973dd
commit
a0c826ed97
|
@ -0,0 +1,13 @@
|
|||
requirements
|
||||
|
||||
- web server (deb: apache | nginx)
|
||||
|
||||
- php support in the web server (deb: php-fpm | libapache2-mod-php)
|
||||
|
||||
- pdo and pdo_sqlite support in php (deb: php-db, php-sqlite3) uncomment in php.ini: ;extension=pdo_sqlite
|
||||
|
||||
TODO
|
||||
|
||||
- jilo-web.db outside web root
|
||||
|
||||
- jilo-web.db writable by web server user
|
|
@ -17,7 +17,7 @@ class Database {
|
|||
}
|
||||
|
||||
public function getConnection() {
|
||||
return $this-pdo;
|
||||
return $this->pdo;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ require 'classes/user.php';
|
|||
unset($error);
|
||||
|
||||
try {
|
||||
$db = new Database('./jilo-web.db');
|
||||
$db = new Database('../jilo-web.db');
|
||||
$user = new User($db);
|
||||
|
||||
if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
|
||||
|
|
|
@ -29,7 +29,10 @@ if (isset($error)) {
|
|||
<body>
|
||||
|
||||
<ul class="menu">
|
||||
<?php if ( !isset($_SESSION['user_id']) ) { ?>
|
||||
<li><a href="login.php">login</a></li>
|
||||
<li><a href="logout.php">logout</a></li>
|
||||
<li><a href="register.php">register</a></li>
|
||||
<?php } else { ?>
|
||||
<li><a href="logout.php">logout</a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
|
Loading…
Reference in New Issue