0
0

Refactored the website

Renamed "includes" to "templates"
Added .htaccess to redirect requests to index.php
Added function to split request URL into array
Corrected locations in scripts and pages
This commit is contained in:
Bryan Pedini
2019-02-07 12:36:44 +01:00
parent 9210890eda
commit 7acb2ca533
8 changed files with 173 additions and 138 deletions

View File

@@ -1,7 +1,7 @@
function urlinsert() {
var url = document.getElementById ( "form-url" ).value;
var xhr = new XMLHttpRequest ( );
xhr.open ( "POST", 'index.php', true );
xhr.open ( "POST", 'insert', true );
xhr.onreadystatechange = function ( ) {
if ( xhr.readyState == XMLHttpRequest.DONE && xhr.status == 200 ) {
if (xhr.status == 200) {
@@ -28,5 +28,5 @@ function urlinsert() {
xhr.send( data );
}
function logout ( ) {
window.location.href = script_name+"?logout";
window.location.href = script_name+"/logout";
}

View File

@@ -3,7 +3,7 @@ function login() {
var password = document.getElementById ( "form-password" ).value;
password = SHA512 ( password );
var xhr = new XMLHttpRequest ( );
xhr.open ( "POST", 'index.php', true );
xhr.open ( "POST", 'login', true );
xhr.onreadystatechange = function ( ) {
if ( xhr.readyState == XMLHttpRequest.DONE && xhr.status == 200 ) {
if (xhr.status == 200) {