Answer the question
In order to leave comments, you need to log in
How to catch input:checked in safari?
Hello comrades, help with the code!
When building this construction, the nested menu (the first item) opens only on the second click, although the menu itself opens normally on the first
<nav class="dws-menu">
<input type="checkbox" name="toggle" id="menu" class="toggleMenu">
<label for="menu" class="toggleMenu"><i class="fa fa-bars"></i>Меню</label>
<ul id="horizontal-multilevel-menu">
<li>
<input type="checkbox" name="toggle" class="toggleSubmenu" id="sub_m1">
<a href="#" ><i class="fa"></i>Первый пункт</a>
<label for="sub_m1" class="toggleSubmenu"><i class="fa"></i></label>
<ul class="sub_menu">
<li><a href="#" >Первый подпункт</a>
<li><a href="#" >Второй подпункт</a>
</ul>
</li>
<li><a href="#" >Второй пункт</a></li>
<li><a href="#" >Третий пункт</a></li>
<li><a href="#" >Четвртый пункт</a></li>
</ul>
<nav>
.dws-menu *{
margin: 0;
padding: 0;
}
.dws-menu ul,
.dws-menu ol{
list-style: none;
}
.dws-menu > ul{
display: flex;
justify-content: center;
}
.dws-menu > ul li{
position: relative;
border-right: 1px solid #c7c8ca;
}
.dws-menu > ul li:first-child{
border-left: 1px solid #b2b3b5;
}
.dws-menu > ul li:last-child{
border-right: 1px solid #babbbd;
}
.dws-menu > ul li > a i.fa{
position: absolute;
top: 15px;
left: 12px;
font-size: 18px;
}
.dws-menu > ul li a{
display: block;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#c9c9c9+0,f6f6f6+2,c4c5c7+98,757577+100;Custom+3 */
background: rgb(201,201,201); /* Old browsers */
background: -moz-linear-gradient(top, rgba(201,201,201,1) 0%, rgba(246,246,246,1) 2%, rgba(196,197,199,1) 98%, rgba(117,117,119,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(201,201,201,1) 0%,rgba(246,246,246,1) 2%,rgba(196,197,199,1) 98%,rgba(117,117,119,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(201,201,201,1) 0%,rgba(246,246,246,1) 2%,rgba(196,197,199,1) 98%,rgba(117,117,119,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#c9c9c9', endColorstr='#757577',GradientType=0 ); /* IE6-9 */
padding: 15px 30px 15px 40px;
font-size: 14px;
color: #454547;
text-decoration: none;
text-transform:uppercase;
transition: all 0.3s ease;
}
.dws-menu li a:hover{
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#e0e1e5+0,454547+2,454547+98,e0e1e5+100 */
background: rgb(224,225,229); /* Old browsers */
background: -moz-linear-gradient(top, rgba(224,225,229,1) 0%, rgba(69,69,71,1) 2%, rgba(69,69,71,1) 98%, rgba(224,225,229,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(224,225,229,1) 0%,rgba(69,69,71,1) 2%,rgba(69,69,71,1) 98%,rgba(224,225,229,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(224,225,229,1) 0%,rgba(69,69,71,1) 2%,rgba(69,69,71,1) 98%,rgba(224,225,229,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e0e1e5', endColorstr='#e0e1e5',GradientType=0 ); /* IE6-9 */
color: #ffffff;
box-shadow: 1px 5px 10px -5px black;
transition: all 0.3s ease;
}
/*sub menu*/
.dws-menu li ul{
position: absolute;
min-width: 150px;
display: none;
}
.dws-menu li > ul li{
border: 1px solid #c7c8ca;
}
.dws-menu li > ul li a{
padding: 10px;
text-transform: none;
background: #e4e4e5;
}
.dws-menu li > ul li ul{
position: absolute;
right: -150px;
top: 0;
}
.dws-menu li:hover > ul{
display: block;
}
/*==== MEDIA ====*/
.dws-menu [type="checkbox"],
.dws-menu label.toggleSubmenu{
display: block; z-index: 10;
}
.dws-menu label.toggleMenu{
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#c9c9c9+0,f6f6f6+2,c4c5c7+98,757577+100;Custom+3 */
background: rgb(201,201,201); /* Old browsers */
background: -moz-linear-gradient(top, rgba(201,201,201,1) 0%, rgba(246,246,246,1) 2%, rgba(196,197,199,1) 98%, rgba(117,117,119,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(201,201,201,1) 0%,rgba(246,246,246,1) 2%,rgba(196,197,199,1) 98%,rgba(117,117,119,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(201,201,201,1) 0%,rgba(246,246,246,1) 2%,rgba(196,197,199,1) 98%,rgba(117,117,119,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#c9c9c9', endColorstr='#757577',GradientType=0 ); /* IE6-9 */
display: none;
padding: 15px 40px;
text-transform: uppercase;
font-size: 14px;
cursor: pointer;
position: relative;
}
.dws-menu label.toggleMenu .fa{
position: absolute;
top: 15px;
left: 12px;
font-size: 18px;
}
@media all and (max-width: 800px){
.dws-menu{
overflow: hidden;
}
.dws-menu ul{
display: block;
max-height: 0;
transition: max-height 0.3s;
}
.dws-menu li>ul li ul{
position: absolute;
right: auto;
top: auto;
}
.dws-menu label.toggleMenu{
display: block;
}
input.toggleMenu:checked + label.toggleMenu{
background: #000;
color: #fff;
}
input.toggleMenu:checked ~ ul,
input.toggleSubmenu:checked ~ ul {
display: block;
position: relative;
max-height: 5000px;
transition: max-height 2s ease-in;
}
.dws-menu label.toggleSubmenu{
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
cursor: pointer;
display: block;
}
input.toggleSubmenu:checked ~ a{
background: #454547;
color: #fff;
}
.dws-menu label.toggleSubmenu .fa:before{
content: "\f0d7";
color: #454547;
}
.dws-menu label.toggleSubmenu .fa{
position: absolute;
top: 15px;
right: 30px;
}
.dws-menu input.toggleSubmenu:checked ~ label.toggleSubmenu .fa::before{
content: "\f0d8";
color: #ffffff;
}
}
Answer the question
In order to leave comments, you need to log in
I already told one person here that you can't do that
$result = mysql_query("SELECT * FROM Clients WHERE login='$login'",$db); /
$myrow = mysql_fetch_array($result);
if(empty($myrow['password'])){
}
/*Подключение к бд разумеется в отдельном файле, а лучше вообще освоить ООП*/
$dsn = "mysql:host=".$host.";dbname=".$db.";charset=".$charset."";
$opt = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
);
$pdo = new PDO($dsn, $user, $pass, $opt);
/*Ваш запрос*/
$query = $pdo->prepare('SELECT COUNT(*) FROM users WHERE login = :login AND password = :password');
$query->execute(array(':login'=>$login, ':password' =>$password));
if($query->fetchColumn() == 1){
}
session_start();
include ("BD_for_users.php");
if(isset($_POST['login']) && isset($_POST['password'])) {
$login = $_POST['login'];
$password = $_POST['password'];
if(empty($login) OR empty($password)){
exit ('<script>alert("Дла начала заполните поля!");</script>');
}
$login = trim(stripslashes(htmlspecialchars($login)));
$password = trim(stripslashes(htmlspecialchars($password))); // надо хранить хеш пароля, а не в чистом виде
$result = mysql_query("SELECT * FROM Clients WHERE login='".$login."' AND password='".$password."'");
$row = mysql_fetch_array($result);
$myrow = mysql_num_rows($result);
if ($myrow == 1){
$_SESSION['login'] = $row['login'];
$_SESSION['id'] = $row['id'];
echo "Вы успешно вошли на сайт! <a href='For_users.php'>Личный кабинет</a>";
}else{
exit ('<script>alert("Извините, введённый вами логин или пароль неверный.");</script>');
}
}
?>
I hope this code does not get into production?
mysql_query returns false on error. You would know this if you read a bit of the documentation . It also says that mysql_ has not been used for a million years. And that passwords need to be hashed. True, they don’t write there that you don’t need to comment on every line of code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question