Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // John123 is username, UDXddM is the password linked to that username. Same markup for all others.
- $login['John123'] = "UDX6672ddM";
- $login['Ramsey123'] = "iGO4u4234TC";
- $login['Nikita123'] = "KLWRES31BYKRBPJM";
- $login['Emma123'] = "PNYUhdhCHU34AQPSUYJ";
- $login['Anna123'] = "PNYZB512SGJkfDALT";
- $login['Peter123'] = "SNZasdVPB56HZSUhkET";
- $login['Bob123'] = "VLPBPH778UATAaGM";
- $login['Ron123'] = "FDSasArhCU90TPDSC";
- $login['Will567'] = "GQgCUF083GTZgsTFPG";
- $login['Oliver123'] = "VAGSE4234GKJXY";
- foreach()
- {
- }
- ?>
- $user = "John123";
- $password = "UDX6672ddM";
- foreach ($login as $key => $value) {
- if ($key == $user) {
- if ($loginArray[$user] == $password) {
- // user and password match
- }
- }
- }
- $user = "John123";
- $password = "UDX6672ddM";
- if (array_key_exists($user, $login)) {
- if ($login[$user] == $password) {
- // user and password match
- } else {
- // user exists but password is wrong
- }
- } else {
- // user doesn't exist
- }
Add Comment
Please, Sign In to add comment