From 5886d48a7f194089401a4c8937d6e1400d328a50 Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Sat, 26 May 2018 14:33:15 +0200 Subject: [PATCH] add tan generation --- entry.php | 12 ++++++++++++ index.php | 4 ++++ js/contentloader.js | 17 +++++++++++++++++ php/generateLink.php | 11 +++++++++++ 4 files changed, 44 insertions(+) create mode 100644 entry.php create mode 100644 php/generateLink.php diff --git a/entry.php b/entry.php new file mode 100644 index 0000000..e8568e1 --- /dev/null +++ b/entry.php @@ -0,0 +1,12 @@ + + + + + + Deine Tan ist: + + + + + + diff --git a/index.php b/index.php index 762662f..8171d06 100644 --- a/index.php +++ b/index.php @@ -8,6 +8,7 @@ + @@ -148,5 +149,8 @@ + + + diff --git a/js/contentloader.js b/js/contentloader.js index e69de29..c019e83 100644 --- a/js/contentloader.js +++ b/js/contentloader.js @@ -0,0 +1,17 @@ +window.addEventListener('load', async () => { + console.log("Seite geladen"); + getNewUniqueLink(); +}) + +async function getNewUniqueLink() { + try { + var firstFetch = await fetch('php/generateLink.php'); + var jsonFirstFetch = await firstFetch.json(); + var content = document.getElementById('content'); + content.innerHTML = `${jsonFirstFetch.html}`; + + } catch (e) { + console.log("Server nicht erreichbar."); + } + +} diff --git a/php/generateLink.php b/php/generateLink.php new file mode 100644 index 0000000..321868f --- /dev/null +++ b/php/generateLink.php @@ -0,0 +1,11 @@ + $resultStr); + echo json_encode($HTMLJSON); + + ?>