linkedin facebook linkedin facebook nod32

Chap menyuni ma’lumotni tahrirlash bo`limini admin panelini yaratish usuli

Muallif: Mengliyev Sh.

Qo`shilgan sana: 2016-02-09

Chap menyuni ma’lumotni tahrirlash bo`limini admin panelini yaratish usuli

Video darslik 

Biz quyidagi chap_tahrirlash.php faylini yaratib olamiz buning uchun quyidagi kodni ko`chrib olamiz.

chap_tahrirlash.php

<?php
include ("lock.php");
include ("baza.php");
if (isset($_GET['id'])) {$id = $_GET['id'];}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tahrirlash saxifasi</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="690" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="main_border">
<tr>
<td class="left"> <p align=center> <b><i>Saytga ma'lumot  kiritish administrator bo`limi</i><b> </p></td>
</tr>
<tr>
<td><table width="690" border="0" cellspacing="0" cellpadding="0">
<tr>
<!--chapmenyuni include yo`rdamida chaqirib olish -->
<? include ("chapmenyu.php");  ?>    
<td valign="top">
<?
if (!isset($id))
{
$result = mysql_query("SELECT title,id FROM chap");     
$myrow = mysql_fetch_array($result);
do
{
printf ("<p><a href='chap_tahrirlash.php?id=%s'>%s</a></p>",$myrow["id"],$myrow["title"]);
}
while ($myrow = mysql_fetch_array($result));
}
else
{
$result = mysql_query("SELECT * FROM chap WHERE id=$id");     
$myrow = mysql_fetch_array($result);
echo "<h3 align='center'>Tahrirlash toifasi</h3>";
print <<<HERE
<form name='form1' method='post' action='chap_baza_tahrir.php'>
<p>
<label>Chap menyu nomi <br>
<input value="$myrow[title]" type="text" name="title" id="title" size="75">
</label>
</p>
<input name="id" type="hidden" value="$myrow[id]">
<p>
<label>
<input type="submit" name="submit" id="submit" value="O'zgarishlarni saqlash ">
</label>
</p>
</form>
HERE;
}
?>
</td>
</tr>
</table></td>
</tr>
<tr>
<td class="left"><p align=center>Saytga ma'lumot  kiritish administrator quyi bo`limi</p></td>
</tr>
</table>
</body>
</html>

Chapmenyudagi ma’lumotni tahrirlash bo`limi chap_baza_tahrir.php quyida php kodi keltirilgan.

chap_baza_tahrir.php

<?php
include ("lock.php");
include ("baza.php");
if (isset($_POST['title']))      
{
$title = $_POST['title'];

if ($title == '')
{
unset($title);

}
if (isset($_POST['id']))      {$id = $_POST['id'];}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tayyorlash</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="690" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="main_border">
<tr>
<td class="left"> <p align=center> <b><i>Saytga ma'lumot  kiritish administrator bo`limi</i><b> </p></td>
</tr>
<tr>
<td><table width="690" border="0" cellspacing="0" cellpadding="0">
<tr>
<!--chapmenyuni include yo`rdamida chaqirib olish -->
<? include ("chapmenyu.php");  ?>    
<td valign="top">
<?php
if (isset($title))
{
/* Bu yerda ma'lumotni bazaga yuboradi */
$result = mysql_query ("UPDATE chap SET title='$title' WHERE id='$id'");
if ($result == 'true') {echo "<p>Bazada chapmenyu yangilandi!</p>";}
else {echo "<p>Bazada chapmenyu yangilanmadi!</p>";}
}                
else
{
echo "<p>Axborot so`rovi bazaga saqlanmadi bazada jadval yo`q.</p>";
}
?>
</td>
</tr>
</table></td>
</tr>
<tr>
<td class="left"><p align=center>Saytga ma'lumot  kiritish administrator quyi bo`limi</p></td>
</tr>
</table>
</body>
</html>

380 marta o`qildi.

Foydalanuvchi ismi: ruslan
Qo`shilgan sana: 2016-02-22

otlichno

Foydalanuvchi ismi: Allayor
Qo`shilgan sana: 2016-03-31

Bu saytni video darslik orqali yaratgansiz menimcha <p style="color:#ff55aa; font-size:28px;">Evgeniy Popov</p>

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
счетчик посещений