linkedin facebook linkedin facebook nod32

Cat menyuni ma’lumotni o`chirish bo`limini admin panelini yaratish usuli

Muallif: Mengliyev Sh

Qo`shilgan sana: 2016-02-09

Cat menyuni ma’lumotni o`chirish bo`limini admin panelini yaratish usuli

Video darslik 

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

cat_uchirish.php

<?php
include ("lock.php");
include ("baza.php");?>
<!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>Guruh betini o'chirish</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">
<p><strong>O'chiriladigan toifani belgilang          </strong></p>
<form action="cat_baza_uchirish.php" method="post">
<?
$result = mysql_query("SELECT title,id FROM cat");     
$myrow = mysql_fetch_array($result);
do
{
printf ("<p><input name='id' type='radio' value='%s'><label> %s</label></p>",$myrow["id"],$myrow["title"]);
}
while ($myrow = mysql_fetch_array($result));
?>
<p> <input name="submit" type="submit" value="Menyuni o`chirish!"></p>
</form>
</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>

Cat menyudagi ma’lumotni o`chirish bo`limi cat_baza_uchirish.php quyida php kodi keltirilgan.

cat_baza_uchirish.php

<?php
include ("lock.php");
include ("baza.php");
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>Qayta ishlash</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($id))
{
$result0 = mysql_query ("SELECT id FROM cat WHERE cat='$id'",$db);
if (mysql_num_rows($result0) > 0) {
echo "<p>Axborot so`rovi bazaga saqlanmadi bazada jadval yo`q.</p>";
}
else
{
$result = mysql_query ("DELETE FROM cat WHERE id='$id'");
if ($result == 'true') {echo "<p>Siz ma`lumotni o`chirishga ulgurdingiz!</p>";}
else {echo "<p>Siz ma`lumotni ulgurmadingiz!</p>";}
}
}                
else
{
echo "<p>Tanlangan so`rov bazaga yuborilmadi. Adminstratorga xat yozing admin@tami.uz. <br> <strong>id xato:</strong></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>

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