Skip to content
Snippets Groups Projects
Commit 4005eebf authored by Miniontoby's avatar Miniontoby :writing_hand_tone1:
Browse files

Fixed the code to make it work

parent 286b43a3
No related branches found
No related tags found
No related merge requests found
.vscode*
\ No newline at end of file
.vscode*
public/config/config.php
\ No newline at end of file
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([/.*]+)(/.*)?$ $1.php$2 [NC,L]
#RewriteRule ^(.*)/([0-9a-zA-Z]+)/([0-9a-zA-Z]+)$ $1?$2=$3 [L,QSA,NC]
RewriteCond %{REQUEST_URI} !^public/
RewriteRule ^(.*)$ public/$1 [L,R=301]
\ No newline at end of file
# MySchoolDay
A school roster project for yh4f
\ No newline at end of file
A school roster project for yh4f
# Usage:
## Setup
For apache2 make sure to have the directory block like this:
```
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
```
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Gegenereerd op: 13 nov 2021 om 17:14
-- Serverversie: 10.3.29-MariaDB-0+deb10u1
-- PHP-versie: 7.3.29-1~deb10u1
--
-- Database: `myschoolday`
--
CREATE DATABASE IF NOT EXISTS `myschoolday` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
USE `myschoolday`;
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`firstname` varchar(100) NOT NULL,
`lastname` varchar(100) NOT NULL,
`email` varchar(1000) NOT NULL,
`school_id` int(11) NOT NULL,
`password` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Indexen voor geëxporteerde tabellen
--
--
-- Indexen voor tabel `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
<?php
$config = [];
$config['dbhost'] = '';
$config['dbuser'] = '';
$config['dbpass'] = '';
$config['dbname'] = '';
return $config;
?>
\ No newline at end of file
<?php
include 'database.php';
include_once 'database.php';
class MySchoolDay {
public $config = [];
public $db = null;
private function __construct() {
$config = include_once 'config.php';
}
public function setup(){
$this->config = include '../config/config.php';
$this->db = new db($this->config['dbhost'], $this->config['dbuser'], $this->config['dbpass'], $this->config['dbname']);
}
};
......
<?php
$config = [];
$config['dbhost'] = 'localhost';
$config['dbuser'] = 'myschoolday';
$config['dbpass'] = 'mYseCurePassWOrd';
$config['dbname'] = 'myschoolday';
return $config;
?>
\ No newline at end of file
......@@ -10,12 +10,12 @@ $app = new MySchoolDay();
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="<?php echo $page_title; ?> - MySchoolDay">
<meta name="twitter:description" content="MySchoolDay WebApp">
<meta name="twitter:image" content="/images/logo.png">
<meta name="twitter:image" content="images/logo.png">
<meta property="og:url" content="">
<meta property="og:type" content="website">
<meta property="og:title" content="<?php echo $page_title; ?> - MySchoolDay">
<meta property="og:description" content="MySchoolDay WebApp">
<meta property="og:image" content="/images/logo.png">
<meta property="og:image" content="images/logo.png">
<meta property="twitter:domain" content="myschoolday.org">
<meta property="twitter:url" content="">
<link rel="shortcut icon" type="image/ico" href="favicon.ico"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment