Skip to content

Instantly share code, notes, and snippets.

Avatar
🏳️‍🌈
Working from home

CuzImBisonratte CuzImBisonratte

🏳️‍🌈
Working from home
View GitHub Profile
View standart.html
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NotenApp</title>
<link rel="icon" type="image/x-icon" href="/res/img/favicon.ico" />
<link rel="apple-touch-icon" href="/res/img/favicon.ico" />
View ID_generator.php
// Functions to generate an ID
function generateIDsection($length){
$id_charset = "abcdefghijklmnopqrstuvwxyz123465789";
$generated = "";
for ($i=0; $i < $length; $i++) {
$new_char = substr($id_charset, mt_rand(0, strlen($id_charset)),1);
$generated .= $new_char;
}
return $generated;
}
@CuzImBisonratte
CuzImBisonratte / check_login.php
Created Jan 7, 2022
Login - Password checker
View check_login.php
// Connect to the database
$con = new mysqli($db_host, $db_user, $db_pass, $dbname);
// Check connection
if ($con->connect_error) {
exit("Connection failed: " . $con->connect_error);
}
// Get the form input
$username = $_POST['username'];
View html.html
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
View accounts.json
{
"testaccount": "password",
"testaccount2": "password2"
}
View formatTime.js
// Function to format the time
function formatTime(number) {
// If the number is not 2 digits, add a 0 in front
if (number.toString().length <= 1) {
// Add a 0 in front
number = "0" + number;
}
View no-cache.html
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
View theme_button.html
<!-- Theme button -->
<div id="themeButton">
<button id="themeToggleButton" onclick="toggleTheme()">Darkmode/Lightmode</button>
</div>
View php_to_database.php
<?php
// Database credentials
$DATABASE_HOST = '';
$DATABASE_USER = '';
$DATABASE_PASS = '';
$DATABASE_NAME = '';
$DATABASE_TABLE = '';
// Connect with the Credentials