From c24d6a52b6c10c0f058d42a731d1031dbcc9183f Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Tue, 13 Aug 2019 18:55:13 +0000 Subject: [PATCH] Bestanden uploaden naar '' --- SYSDesk.sql | 13 ++++ config.php.sample | 16 ++++ setup.php | 183 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 212 insertions(+) create mode 100644 SYSDesk.sql create mode 100644 config.php.sample create mode 100644 setup.php diff --git a/SYSDesk.sql b/SYSDesk.sql new file mode 100644 index 0000000..0ba7c32 --- /dev/null +++ b/SYSDesk.sql @@ -0,0 +1,13 @@ +-- phpMyAdmin SQL Dump +-- version 4.9.0.1 +-- https://www.phpmyadmin.net/ +-- +-- Host: localhost +-- Generation Time: Aug 13, 2019 at 05:16 PM +-- Server version: 10.2.25-MariaDB-cll-lve +-- PHP Version: 5.5.38 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +SET time_zone = "+00:00"; diff --git a/config.php.sample b/config.php.sample new file mode 100644 index 0000000..0791e7f --- /dev/null +++ b/config.php.sample @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/setup.php b/setup.php new file mode 100644 index 0000000..c921c9e --- /dev/null +++ b/setup.php @@ -0,0 +1,183 @@ + + +"; + echo "DBName:

"; + echo "DBUser:

"; + echo "DBPassword:

"; + echo "
"; +echo ""; +} + +if ($step == '2') { +echo "If conection faild click here
"; +require_once "$configfilePath"; +mysqli_close($link); +header("Location: setup.php?step=3"); +} + + +if ($step == '3') { +echo "Populating DB"; +require_once "$configfilePath"; + $templine = ''; + $lines = file($sqlfileName); + $error = ''; + foreach ($lines as $line){ + if(substr($line, 0, 2) == '--' || $line == ''){ + continue; + } + $templine .= $line; + if (substr(trim($line), -1, 1) == ';'){ + if(!$link->query($templine)){ + $error .= 'Error performing query "' . $templine . '": ' . $link->error . '

'; + } + $templine = ''; + } + } +header("Location: setup.php?step=4"); +} + + +if ($step == '4') { +echo"

Please fill this form to create an account.

"; +echo"
"; + echo"
"; + echo"
"; + echo""; + echo" $username_err "; + echo"
"; + echo"
"; + echo"
"; + echo""; + echo" $password_err"; + echo"
"; + echo"
"; + echo"
"; + echo ""; + echo" $confirm_password_err "; + echo"
"; + echo "
"; +echo "
"; +} + +if ($step == '5') { +echo "Setup done !"; +echo"
"; +echo "Please remove setup.php, config.php.sample and your .SQL file"; +} + +?> \ No newline at end of file