$login = $_POST['login']; $pass = $_POST['pass'];
$db = mysqli_connect('localhost','root','','test');
if ($db == false) {
echo 'ERROR: '.mysqli_connect_error();
die();
}
$result = mysqli_query($db,"SELECT * FROM `users` WHERE `login` = '$login'");
while (($user = mysqli_fetch_assoc($result))) {
if (password_verify($pass, $user['pass'])){
echo '<h1>Привет, <i>' . $user['login'] .'</i></h1>';
}else{
echo 'Такого пользователя нет!';
}
}
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./serviceworker.js').then(function(registration) {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function(err) {
console.log('ServiceWorker registration failed: ', err);
});
}
'use strict';
var cacheVersion = 1;
var currentCache = {
offline: 'offline-cache' + cacheVersion
};
const offlineUrl = 'offline.html';
this.addEventListener('install', event => {
event.waitUntil(
caches.open(currentCache.offline).then(function(cache) {
return cache.addAll([
offlineUrl
]);
})
);
});
this.addEventListener('fetch', event => {
if (event.request.mode === 'navigate' || (event.request.method === 'GET' && event.request.headers.get('accept').includes('text/html'))) {
event.respondWith(
fetch(event.request.url).catch(error => {
// Return the offline page
return caches.match(offlineUrl);
})
);
}
else{
event.respondWith(caches.match(event.request)
.then(function (response) {
return response || fetch(event.request);
})
);
}
});
Array
(
[0] => stdClass Object
(
[src] => https://pp.userapi.com/c854120/v854120638/9f1c1/cOCtSmnPsG0.jpg
[width] => 130
[height] => 73
[type] => m
)
[1] => stdClass Object
(
[src] => https://pp.userapi.com/c854120/v854120638/9f1c6/FRQZDXQUS0Q.jpg
[width] => 130
[height] => 87
[type] => o
)
[2] => stdClass Object
(
[src] => https://pp.userapi.com/c854120/v854120638/9f1c7/CJ3u8EmY690.jpg
[width] => 200
[height] => 133
[type] => p
)
[3] => stdClass Object
(
[src] => https://pp.userapi.com/c854120/v854120638/9f1c8/DPX4sLUqqHo.jpg
[width] => 320
[height] => 213
[type] => q
)
[4] => stdClass Object
(
[src] => https://pp.userapi.com/c854120/v854120638/9f1c9/u0HGM2Sh27M.jpg
[width] => 510
[height] => 340
[type] => r
)
[5] => stdClass Object
(
[src] => https://pp.userapi.com/c854120/v854120638/9f1c0/25wXsz77FBk.jpg
[width] => 75
[height] => 42
[type] => s
)
[6] => stdClass Object
(
[src] => https://pp.userapi.com/c854120/v854120638/9f1c5/HbOlfYh-C0E.jpg
[width] => 1920
[height] => 1080
[type] => w
)
[7] => stdClass Object
(
[src] => https://pp.userapi.com/c854120/v854120638/9f1c2/QHcv2iomk4c.jpg
[width] => 604
[height] => 340
[type] => x
)
[8] => stdClass Object
(
[src] => https://pp.userapi.com/c854120/v854120638/9f1c3/O4vBsQ_RS_4.jpg
[width] => 807
[height] => 454
[type] => y
)
[9] => stdClass Object
(
[src] => https://pp.userapi.com/c854120/v854120638/9f1c4/Md-NMmku3jQ.jpg
[width] => 1280
[height] => 720
[type] => z
)
)
Array
(
[0] => stdClass Object
(
[src] => https://pp.userapi.com/c852220/v852220720/17f095/a7RQbHW3esM.jpg
[width] => 75
[height] => 75
[type] => s
)
[1] => stdClass Object
(
[src] => https://pp.userapi.com/c852220/v852220720/17f096/A6izcoRmOgM.jpg
[width] => 130
[height] => 130
[type] => m
)
[2] => stdClass Object
(
[src] => https://pp.userapi.com/c852220/v852220720/17f097/cMjqE2lf9V0.jpg
[width] => 600
[height] => 600
[type] => x
)
[3] => stdClass Object
(
[src] => https://pp.userapi.com/c852220/v852220720/17f098/izTPGD49V78.jpg
[width] => 130
[height] => 130
[type] => o
)
[4] => stdClass Object
(
[src] => https://pp.userapi.com/c852220/v852220720/17f099/OOgxsbmo0IM.jpg
[width] => 200
[height] => 200
[type] => p
)
[5] => stdClass Object
(
[src] => https://pp.userapi.com/c852220/v852220720/17f09a/uoNS6Ir2nPs.jpg
[width] => 320
[height] => 320
[type] => q
)
[6] => stdClass Object
(
[src] => https://pp.userapi.com/c852220/v852220720/17f09b/NHy4sQBoNEU.jpg
[width] => 510
[height] => 510
[type] => r
)
)