Current directory: /home/klas4s23/domains/585455.klas4s23.mid-ica.nl/public_html/Gastenboek/uploads
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="gastenboek.css">
<link rel="icon" type="image/x-icon" href="images/cat.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Whisper&display=swap" rel="stylesheet">
<link rel=βstylesheetβ href=βhttps://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.cssβ>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://www.viralpatel.net/demo/jquery/jquery.shorten.1.0.js"></script>
<title>Nancy's guestbook</title>
</head>
<body>
<form action="extra/upload.php" method="post" enctype="multipart/form-data">
<div class="formPlacement">
<h1>Guestbook</h1>
<h1 id="nancy">Nancy<img id="nameIcon" src="images/cat.png"></h1>
<label>Name:</label>
<input type="text" name="name" id="name" class="inputFields"
placeholder="(Limit 30char)" maxlength="30" required>
<label>E-mail:</label>
<input type="text" name="email" id="email" class="inputFields"
placeholder="(Limit 100char)" maxlength="100" required>
<label>Image (optional)</label>
<label id="chooseText">Choose an image </label>
<label id="requirementText">
(can
only be a <span class="details">.png, .jpg, .jpeg</span> or <span class="details">.gif</span> )<br>
Max file size <span class="details">10 MB</span></label>
<input type="file" name="uploadedFile"></input>
<label>Comment:</label><textarea name="comment" id="comment" class="inputFields" rows="5" cols="40"
placeholder="(Limit 255char)" maxlength="255" required></textarea>
<p id="error"></p>
<button name="uploadButton" id="submit">Submit</button>
</div>
<div class="commentsPlacement">
<div id="comments">
<?php
require_once "extra/display.php";
?>
</div>
</div>
</form>
<script>
//restrictions frontend
document.getElementById("name").addEventListener("blur", function (event) {
myFunction(event)
});
document.getElementById("email").addEventListener("blur", function (event) {
myFunction(event)
});
document.getElementById("comment").addEventListener("blur", function (event) {
myFunction(event)
});
function myFunction(event) {
if (event.target.value == "") {
event.target.style.borderColor = "red";
document.getElementById("error").style.display = "block";
document.getElementById("error").innerHTML = "Please fill all the fields in.";
} else {
event.target.style.borderColor = "#ded2b4";
document.getElementById("error").innerHTML = "";
document.getElementById("error").style.display = "none";
}
}
//show more/less jquery plugin
$(".commentContent").shorten({
"showChars": 22,
"moreText": "See More",
"lessText": "Less",
});
</script>
</body>
</html>