Merge pull request #1 from iCaotix/generateUniqueLinks
add tan generation
This commit is contained in:
commit
507f65dcb0
12
entry.php
Normal file
12
entry.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
Deine Tan ist:
|
||||||
|
|
||||||
|
<?php echo $_GET["tan"]; ?>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
<!-- Bootstrap CSS -->
|
<!-- Bootstrap CSS -->
|
||||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
||||||
@ -148,5 +149,8 @@
|
|||||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
|
||||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
<!-- import contentloader-->
|
||||||
|
<script src="js/contentloader.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -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.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
11
php/generateLink.php
Normal file
11
php/generateLink.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$uniqueID = uniqid();
|
||||||
|
$resultStr = "Neuer eintrag über: http://localhost/github/ipr-projekt/entry.php?tan=";
|
||||||
|
$resultStr = $resultStr . uniqid();
|
||||||
|
|
||||||
|
|
||||||
|
$HTMLJSON = array('html' => $resultStr);
|
||||||
|
echo json_encode($HTMLJSON);
|
||||||
|
|
||||||
|
?>
|
Loading…
Reference in New Issue
Block a user