Quick actions

cmd+k|ctrl+k

Navigation

Languages

Authorization using cookies

Snippet info

Language

Php

Visibility

public

Author

mynameisjoker

Created

2017-01-23T13:03:25Z

Updated

2017-01-23T13:03:25Z

<?php
	if($_REQUEST["remember"]) {
		setcookie("cook", $password, time()+3600, "/");
	}
?>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Авторизация через куки</title>
	<style>
	    * {
	transition: all .2s;
}
body {
	background: #fff url("../images/old_mathematics.png");
	font-size: 24px;
	font-family: 'PT Sans';
}

.container {
	width: 1200px;
	height: 600px;
}
#myform {
	width: 300px;
	height: 200px;
	margin-top: 17px;
	padding-left: 10px;
	padding-top: 15px;
	margin-left: 550px;
	background: #fff;
	border-radius: 3px;
}
@font-face {
	font-family: 'PT Sans';
	src: url("../fonts/pt-sans57.ttf");
}

label[for="login"]::after {
	content: ' ';
	margin-left: 36px;
}

label[for="password"]::after {
	content: ' ';
	margin-left: 10px;
}

#button {
	width: 80px;
	height: 30px;
	cursor: pointer;
	color: #fff;
	background: #a2e2ac;
	border-radius: 3px;
	margin-left: 100px;

	-moz-transition: background .2s ease-out;
	-webkit-transition: background .2s ease-out;
	-o-transition: background .2s ease-out;
	transition: background .2s ease-out;
}

#button:hover {
	background: #000;
}

#button:active {
	transform: scale(0.8);
}

@media only screen and (max-width: 600px) {
	.container {
		width: 500px;
		height: 500px;
	}
}

@media only screen and (max-width: 400px) {
	.container {
		width: 280px;
		height: 200px;
		margin: 0 auto;
	}
	#myform {
		width: 280px;
		height: 200px;
		margin: 0 auto;
	}
	#button {
		margin-left: 100px;
	}
}


	</style>
</head>
<body>
		<div class="container">
	<div id="myform">
	<form action='auth.php' method='POST'>
		<label for="login">Login:</label><input type="text" name='login'><br>
		<label for="password">Password</label><input name='password' type='password'><br>
		<label for="remember">Remember Me</label><input name='remember' type='checkbox' value='1'><br>
		<input type='submit' value='Отправить' id="button">
	</form>
	</div>
		</div>
</body>
</html>
INFO