Skip to content

Instantly share code, notes, and snippets.

View CuzImBisonratte's full-sized avatar
🏳️‍🌈

CuzImBisonratte CuzImBisonratte

🏳️‍🌈
View GitHub Profile
<?php
$password = password_hash($_POST['password'], PASSWORD_DEFAULT);
?>
<?php
// Database credentials
$DATABASE_HOST = '';
$DATABASE_USER = '';
$DATABASE_PASS = '';
$DATABASE_NAME = '';
$DATABASE_TABLE = '';
// Connect with the Credentials
<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" />
<!-- Theme button -->
<div id="themeButton">
<button id="themeToggleButton" onclick="toggleTheme()">Darkmode/Lightmode</button>
</div>
@CuzImBisonratte
CuzImBisonratte / accounts.json
Last active January 6, 2022 14:11
Login Skript
{
"testaccount": "password",
"testaccount2": "password2"
}
@CuzImBisonratte
CuzImBisonratte / check_login.php
Created January 7, 2022 17:00
Login - Password checker
// 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'];
// 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;
}
@CuzImBisonratte
CuzImBisonratte / only_numbers
Created June 23, 2022 17:28
regex-snippets
/^[0-9]+$
// 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 / html.html
Last active October 19, 2022 17:36
Structures
<!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>