linkedin facebook linkedin facebook nod32

Php da chap tomonli menyu hosil qilish

Muallif: Mengliyev Sh.

Qo`shilgan sana: 2015-12-18

Php da chap tomonli menyu hosil qilish

Video darslik

Chap tomon menyu hosil qilamiz
chap bazani phpMyadmin ga baza hosil qilib ushbu bazanomi yaratilgandan so`ng sql qismiga joylashtiring

CREATE TABLE `chap` (
`id` int( 10 ) NOT NULL AUTO_INCREMENT ,
`title` varchar( 255 ) NOT NULL default '',
KEY `id` ( `id` )
)

Jаdvаl (nоmi chap), qоldirilgаn mа’lumоtlаrni o‘z ichigа оlib, quyidаgi tаrkibgа egа:

id - yozuvning identifikаtsiоnn unikаl nоmeri;
title – sahifa mavzusi;

cat bazani phpMyadmin ga baza hosil qilib ushbu bazanomi yaratilgandan so`ng sql qismiga joylashtiring

CREATE TABLE `cat` (
`id` int( 10 ) NOT NULL AUTO_INCREMENT ,
`cat` int( 2 ) NOT NULL default '0',
`title` varchar( 255 ) NOT NULL default '',
`meta_d` varchar( 255 ) NOT NULL default '',
`meta_k` varchar( 255 ) NOT NULL default '',
`text` text NOT NULL default '',

KEY `id` ( `id` )
)

Jаdvаl (nоmi cat), qоldirilgаn mа’lumоtlаrni o‘z ichigа оlib, quyidаgi tаrkibgа egа:
id - yozuvning identifikаtsiоnn unikаl nоmeri;
cat- categoriyalarni tanlash bo`limi;
title– sahifa mavzusi;
meta_d – qidruv tizimi bo`yicha sarlavha so`zlar;
meta_k – qidruv tizimi bo`yicha kalit so`zlar;
text– mavzu bayonini kiritish bo`limi;

chapmenyu.php

<?
$result = mysql_query("SELECT * FROM chap",$db);
if (!$result)
{ echo "<p>Tanlangan so'rov bazaga yuborilmadi. Adminstratorga xat yozing admin@tami.uz. <br> <strong>Kodda xato:</strong></p>";
exit(mysql_error()); }
if (mysql_num_rows($result) > 0 ) {
$myrow = mysql_fetch_array($result);
do { printf ("<li class='portal-menu'><a>%s</a>",$myrow["title"]);
$id=$myrow["id"];
$result2 = mysql_query("SELECT * FROM cat WHERE cat='$id'",$db);
if (!$result2)
{ echo "<p>Tanlangan so'rov bazaga yuborilmadi. Adminstratorga xat yozing admin@tami.uz. <br> <strong>Kodda xato:</strong></p>";
exit(mysql_error()); }
if (mysql_num_rows($result2) > 0) {
$myrow2 = mysql_fetch_array($result2);

do {
printf ("<a href='cat_qarang.php?cat=%s'>%s</a>",$myrow2["id"],$myrow2["title"]);
}

while ( $myrow2 = mysql_fetch_array($result2));

} }
while ($myrow = mysql_fetch_array($result));
}
else { echo "<p>Axborot so'rovi bazaga saqlanmadi bazada jadval yo'q.</p>";
exit();
}
?>
</body>
</html>

Css fayliga joylashtirish kerak ihtiyoriy .css fayliga

.sidebar_menu li:hover {
width:220px;
height:100%;
}
.sidebar_menu li a {
display:block;
width:195px;
height:40px;
line-height:40px;
background:#bbb;
margin:1px;
color:#000;
padding-left:15px;
cursor:pointer;
border-radius:10px;
-moz-transition:background .4s ease-in-out;
-webkit-transition:background .4s ease-in-out;
-o-transition:background .4s ease-in-out;
transition:background .4s ease-in-out;
}
.sidebar_menu li a:hover {
background:#4E8204;
}
.sidebar_menu {
list-style: none;
margin: 12px 0 25px;
padding: 0;
width:50px;
opacity:1.5;
}
.sidebar_menu:hover {
opacity:2;
-moz-transition: width .9s ease-in-out,height .9s ease-in-out ;
-webkit-transition: width .9s ease-in-out,height .9s ease-in-out ;
-o-transition: width .9s ease-in-out,height .9s ease-in-out ;
transition: width .9s ease-in-out,height .9s ease-in-out ;
}
.sidebar_menu li {
margin: 0;
padding: 1px 0 3px 3px;
border-bottom: 1px dotted #ccc;
height:49px;
width:212px;
overflow:hidden;
padding:0px;
position: relative;
}
.sidebar_menu li:hover {
width:220px;
height:100%;
}

.sidebar_menu li a {
display:block;
width:195px;
height:40px;
line-height:40px;
background:#bbb;
margin:1px;
color:#000;
padding-left:15px;
cursor:pointer;
border-radius:10px;
-moz-transition:background .4s ease-in-out;
-webkit-transition:background .4s ease-in-out;
-o-transition:background .4s ease-in-out;
transition:background .4s ease-in-out;
}
.sidebar_menu li a:hover {
background:#4E8204;
}
.sidebar_menu li a:first-child {
font-size:1.1em;
height:50px;
line-height:50px;
position:relative;
text-indent:15px;
}
.sidebar_menu li a:first-child::before {
content:'';
position:absolute;
display:block;
height:32px;
width:32px;
top:9px;
left:0;
}
.portal-menu a:first-child::before {
background: url(../images/templatemo_list.png) center no-repeat ;
}
.web-menyu a:first-child::before {
background: url(../images/templatemo_list.png) center no-repeat ;
}
.Dastur-menyu a:first-child::before {
background: url(../images/templatemo_list.png) center no-repeat ;
}
.zzzzz1 {
height: 100%;
background: none repeat scroll 0% 0% rgba(243, 237, 237, 1);
border: 0px solid rgba(0, 0, 0, 1);
border-radius: 20px;
margin: 6% 0% 6% 0%;
padding: 5px 5px 15px 15px;
border-top: medium solid rgba(224, 224, 224, 1);
border-bottom: medium solid rgba(224, 224, 224, 1);
}
.post_title {background-color:#f6f6f6;}
.post_name {font-weight:bold; margin-top:7px; margin-bottom:7px;}
.post_title2 {
margin-center:10px;
font-size:18px;
font-weight:bold;
color:#0916F4;
text-align:center;
background-color:rgba(161, 161, 161, 1);
}
.post_add {
font-size:11px;
margin-top:10px;
margin-bottom:10px;
font-weight:bold;
}
.h18 {
height:20px;
display:block;
position:absolute;
padding:1px 1px 1px;
border-radius:5px; margin:14px 2px 2px 727px;
}
#content2 {
float: right;
width: 453px;
padding: 9px 10px 20px;
background:#DCDCDC; border:2px solid #edf2f6;
border-radius:10px; margin:60px 250px 13px 240px ;
position:absolute;
}
.col { float: left; margin-right: 20px }
.col_13 { width: 300px }
#contact_form form .submit_btn { display: block; padding: 5px 12px; text-align: center; text-decoration: none; font-weight: bold; border: 1px solid #000; color: #fff; font-size:11px; cursor: pointer;
width:62px; height:37px;
}
.submit_btn{background:url(../img/res.png) no-repeat scroll 50% 50% transparent;}
.float_l { float: left }
.float_r { float: right }
.cleaner { clear: both; margin: -25px 6px 14px 14px;}
.cleaner hr { background-color:#03C; border-bottom-width:2px; margin: -25px 6px 14px 14px;}
.h10 { height: 10px }
.h20 { height: 68px }
.h30 { height: 30px }
.h40 { height: 17px }
.h50 { height: 50px }
.sinput {
width:190px;
height:25px;
background-color:#f6f6f6;
border:1px solid gray;
}
.sbutton {
width:190px;
height:25px;
background-color:#cc0000;
color:#FFFFFF;
border:1px solid gray;
}
.post_secret {font-weight:bold; margin-top:7px; margin-bottom:7px;}
.post_secret a {color:#666666; text-decoration:none;}Ihtiyoriy chap bo`limga joylashtiramiz

Index.php, vedio_kurs.php, muallif.php va bog`lanish.php ga chap qismiga joylashtirib chiqamiz

<ul class="sidebar_menu">
<? include ("chapmenyu.php"); ?>
</ul>

2047 marta o`qildi.

Parol:
Eslab qolish.


Ro`yhatdan o`tish

testing

+998915878681

Siz o`z maxsulotingizni 3D reklama ko`rinishda bo`lishini xohlaysizmi? Unda xamkorlik qilamiz.

3D Reklama


Рейтинг@Mail.ru
Рейтинг@Mail.ru

Besucherzahler
счетчик посещений