Skip to content

Instantly share code, notes, and snippets.

View Boost9898's full-sized avatar
🎯
Focusing

Bram Boost9898

🎯
Focusing
View GitHub Profile
let receipts = document.getElementsByTagName('li');
let total = 0.0;
// test of de tags gevonden zijn
console.log(receipts);
for (let i = 0; i < receipts.length; i++) {
let totalString = receipts[i].innerHTML;
total += parseFloat(totalString);
<?php
/**
* @return array
*/
function getDishes()
{
return [
[
"id" => 1,
"name" => "Big Mac",
<?php
$timestamp = strtotime($datum); // Creating timestamp from given date
$new_date = date("d-m-Y", $timestamp); // Creating new date format from that timestamp
?>
<?php
function escapeInput($value) {
global $conn;
return mysqli_real_escape_string($conn, trim($value));
}
?>
<?php
session_start(); //sessie startren
session_destroy(); //sessie verwijderen
// header ('location: login.php'); //redirect naar login
exit; //sluiten
?>
@Boost9898
Boost9898 / login-validation.php
Last active January 19, 2020 19:17
Log-in form validation with e-mail
<?php
if (isset($_POST['submit'])) { //controleren of formulier verzonden is
$email = $_POST['email']; //indien verzonden variabelen vullen
$password = $_POST['password'];
$sql = "SELECT * FROM `registratie` WHERE `email` = '$email'"; //query in variabel stoppen
$result = $conn->query($sql);
if (empty($email)) { //error handling
$_SESSION["error"] = "Vul een e-mailadres in"; //variabel error vulen waar ajax gebruik van maakt