diff options
author | Sebastian Korotkiewicz <skorotkiewicz@gmail.com> | 2022-03-19 09:17:55 +0100 |
---|---|---|
committer | Sebastian Korotkiewicz <skorotkiewicz@gmail.com> | 2022-03-19 09:17:55 +0100 |
commit | 53da95395aad137bd0ab2b2f4ed1e9e3cb00c962 (patch) | |
tree | b101ce45b258711180a1cc16fcc27bdf5d252241 /store/browser/db.php | |
download | site_roulette-53da95395aad137bd0ab2b2f4ed1e9e3cb00c962.tar.gz |
Initial commit
Diffstat (limited to 'store/browser/db.php')
-rw-r--r-- | store/browser/db.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/store/browser/db.php b/store/browser/db.php new file mode 100644 index 0000000..bfe73d8 --- /dev/null +++ b/store/browser/db.php @@ -0,0 +1,23 @@ +<?php + +$db = new PDO('sqlite:db_websites.sqlite3'); + +$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + +$query = "CREATE TABLE IF NOT EXISTS websites +(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + login_name TEXT +)"; + +$db->exec($query); + +function cleanText($value) { + $value = strip_tags($value); + $value = htmlentities($value, ENT_QUOTES, "UTF-8"); + $value = trim($value); + $value = stripslashes($value); + $value = strval($value); + return $value; +} + +?> \ No newline at end of file |