fix compilation errors; add public folder

This commit is contained in:
2018-02-11 21:29:24 +01:00
parent bd06342ccf
commit b8f8fc1f69
5 changed files with 45 additions and 39 deletions

View File

@@ -2,8 +2,8 @@
$db_file = "db_file.sqlite";
// create database file when not existent yet
if (!file_exists($db_file)) {
$db = new PDO('sqlite:' . $db_file);
if (!file_exists($db_file)) {
$db = new PDO('sqlite:' . $db_file);
$db->exec("CREATE TABLE registrations(
id INTEGER PRIMARY KEY AUTOINCREMENT,
first_name TEXT,
@@ -14,16 +14,16 @@ if (!file_exists($db_file)) {
verify_token TEXT,
request_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP)");
}
else {
else {
// establish connection
$db = new PDO('sqlite:' . $db_file);
$ins_stmt = $db->prepare("INSERT INTO registrations
(first_name, last_name, note, email, username, verify_token)
VALUES (:first_name, :last_name, :note, :email, :username, :verify_token);
VALUES (:first_name, :last_name, :note, :email, :username, :verify_token)");
}
// set writeable when not set already
if (!is_writable($db_file)) {
chmod($db_file, 0777);
}
}
?>