Sixtens hemsida Uppgifter Blogg Om

Bankapplikation med databas

Gå till sida

Källkod

bank_sql/

logout.php

transfer.php

index.php

login.php

manage.php

signup.php

change_password.php

PREP/

POPULATE.php

QUERIES.sql

modules/

user.php

page.php

database.php

session.php

utility.php

wesweb01/bank_sql/PREP/POPULATE.php

2 lines
<?php
require("../modules/utility.php");
$users = array(
    
'alex_jones' => 'BlueSky!82',
    
'maria.lopez' => 'CoffeeBean#91',
    
'daniel_smith' => 'RiverRun$37',
    
'emily_chen' => 'MoonLight@14',
    
'james_walker' => 'SunsetPath!56',
    
'olivia_brown' => 'MintLeaf$92',
    
'ryan_kim' => 'StormRider@75',
    
'sophia_garcia' => 'RosePetal#48',
    
'michael_adams' => 'CloudNine!67',
    
'isabella_lee' => 'SilverWave$23',
    
'ethan_clark' => 'BrightStar@19',
    
'ava_rodriguez' => 'GoldenSun#73',
    
'liam_nguyen' => 'OceanBreeze!41',
    
'mia_johnson' => 'QuietNight$59',
    
'noah_patel' => 'FireFly@32',
    
'amelia_morris' => 'CherryTree#27',
    
'lucas_cooper' => 'DreamCatcher!85',
    
'charlotte_hill' => 'VelvetMoon$11',
    
'benjamin_davis' => 'ForestPath@68',
    
'ella_white' => 'RainDance#95',
    
'jack_taylor' => 'CrystalLake!29',
    
'harper_allen' => 'SoftWind$74',
    
'william_moore' => 'MorningSky@26',
    
'evelyn_harris' => 'WildRose#62',
    
'henry_thompson' => 'SnowFall!34',
    
'grace_martin' => 'SilverLeaf$57',
    
'samuel_james' => 'FireStone@83',
    
'lily_clark' => 'AmberGlow#49',
    
'jacob_wilson' => 'WinterRain!21',
    
'aria_evans' => 'GoldenBird$64',
    
'logan_turner' => 'BlueRiver@38',
    
'zoe_scott' => 'NightBloom#87',
    
'sebastian_bell' => 'IronHeart!30',
    
'nora_brooks' => 'CrystalHill$44',
    
'elijah_reed' => 'FrostLight@53',
    
'hannah_gray' => 'SilverRain#70',
    
'matthew_price' => 'QuietStorm!46',
    
'violet_wright' => 'OceanWave$77',
    
'carter_bailey' => 'WildSky@55',
    
'ella_ross' => 'GoldenLeaf#33',
    
'owen_parker' => 'RainDrop!72',
    
'stella_foster' => 'MorningStar$68',
    
'jayden_wood' => 'FireMoon@47',
    
'lucy_hall' => 'DreamLight#24',
    
'jackson_kelly' => 'AmberSky!60',
    
'hazel_reed' => 'QuietRiver$31',
    
'aiden_cook' => 'CloudStep@79',
    
'luna_richards' => 'VelvetStar#42',
    
'leo_howard' => 'SilverMist!25',
    
'chloe_bennett' => 'CrystalWave$58'
);

$query "INSERT INTO user(username, passwordHash, passwordSalt) VALUES ";
//$query = "INSERT INTO user(username, password, mail) VALUES ";
$f false;
foreach (
$users as $name => $pass) {
    if (
$f)
        
$query .= ",";
    
$query .= "
"
;
    
$salt generate_salt();

    
$hash hash_password($pass$salt);
    
$query .= "('{$name}', '{$hash}', '{$salt}')";
    
//$hash = hash("sha256", $pass, false);
    // $query .= "('{$name}', '{$hash}', '{$name}@gmail.com')";
    
$f true;
}
$query .= ";";


echo 
"<pre>{$query}</pre>";
?>