Skip to main content

Posts

PHP#18MySQL#14 - Thêm, Xóa, Sửa, Lọc theo ngôn ngữ, lọc theo thể loại, loại

  //theloai.php <!doctype html> <html> <head> <meta charset="utf-8"> <title>Thể Loại</title> </head> <body> <?php include("../connect.php"); if(isset($_GET['lang'])) $lang=$_GET['lang']; else $lang="vi"; ?> <form method="get" id="form1" name="form1">   <p>     <label for="select">Chọn ngôn ngữ:</label>     <select name="lang" id="lang" onChange="form1.submit();">       <option value="vi">Việt</option>       <option value="en"<?php if($lang=="en") echo "selected";?>>English</option>     </select>   </p> </form> <table width="700" border="1" cellspacing="0" cellpadding="0">   <tbody>     <tr>       <th scope="col">Thứ tự</t...

PHP#17MySQL#13 - Trang xử lý THÊM dữ liệu (process.php) - Chuyển trang trong PHP: header("location:theloai.php");

<?php  include("../connect.php"); if(isset($_POST['themtl'])) { $sl="insert into theloai values(NULL,'{$_POST['lang']}', '{$_POST['TenTL']}', '{$_POST['TenTL_KhongDau']}', {$_POST['ThuTu']}, {$_POST['AnHien']})"; if(mysqli_query($link,$sl)) header("location:theloai.php"); else echo $sl; } ?>

PHP#17MySQL#13 - Admin/theloai_them.php - $_GET['lang']) sau đó selected ngôn ngữ

 <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <?php  if(isset($_GET['lang'])) $lang=$_GET['lang']; else $lang="vi"; ?> <form method="post" id="form1" name="form1" action="process.php" >   <p>     <label for="lang">Ngôn ngữ:</label>     <select name="lang" id="lang">       <option value="vi">Việt</option>       <option value="en" <?php if($lang=="en") echo "selected";?> >English</option>     </select>   </p>   <p>     <label for="ThuTu">Thứ tự:</label>     <input name="ThuTu" type="text" id="ThuTu" size="5">   </p>   <p>     <label for="TenTL">Tên TL:</label...

PHP#17MySQL#13 - Admin/theloai.php - Lọc thể loại theo ngôn ngữ, selected ngôn ngữ, chuyển trang kèm theo ngôn ngữ

<!doctype html> <html> <head> <meta charset="utf-8"> <title>Thể Loại</title> </head> <body> <p> <?php  if(isset($_GET['lang'])) $lang=$_GET['lang']; else $lang="vi"; ?>  <form id="form1" name="form1" method="get" action="">   <label for="lang">Chọn ngôn ngữ:</label>   <select name="lang" id="lang" onChange="form1.submit();">     <option value="vi">Việt</option>     <option value="en" <?php if($lang=="en") echo "selected";?> >English</option>   </select>  </form> </p> <table width="700" border="1" cellspacing="0" cellpadding="0">   <tbody>     <tr>       <th scope="col">Thứ tự</th>       <th scope="col">Tê...

PHP#17MySQL#13 - tin cũ hơn

//chitiettin.php <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <?php if(isset($_GET['idTin'])) { $idTin=$_GET['idTin']; include("connect.php"); $sl="select idLT, TieuDe, TomTat, Content from tin where idTin=$idTin"; $kq=mysqli_query($link,$sl); $d=mysqli_fetch_array($kq) ?> <h1 align="center"><?php echo $d['TieuDe'];?></h1> <div><?php echo $d['TomTat'];?></div> <div><?php echo $d['Content'];?></div> <?php }?> <p> các tin cũ hơn(lấy 5 tin cũ hơn và cùng loại tin với tin đang mở, sắp xếp từ mới đến cũ </p> <ul> <?php  $sltc="select * from tin where AnHien=1 and idLT={$d['idLT']} and idTin < $idTin order by idTin DESC limit 0,5"; $kqtc=mysqli_query($link,$sltc); while($dtc=...

PHP#16MySQL#12 - index.php, include

https://app.mediafire.com/fwx971t2bbggr  //index.php <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <link href="c2.css" rel="stylesheet" type="text/css"> </head> <body> <div id="container"> <div id="header"> </div>    <div id="thanhmenu"><?php include("menu.php");?></div>   <div id="main1">     <div id="main1_1"><?php include("tinnoibat.php");?></div> <div id="main1_2"><?php include("tinxemnhieu.php");?></div> <div id="main1_3">  </div> </div> <div id="quangcao"> </div> <div id="main2"> <div id="main2_1"> <?php  if(isset($_GET['key'])) { switch($_GET['key'])...

PHP#15MySQL#11 chèn link, rót dữ liệu, phân trang

//tinmoi.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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> #tinmoi {width: 660px;} #tinmoi .tinmoinhat { width:330px; float:left; color:#336699; height: 175px; overflow: hidden; } #tinmoi .tinmoitieptheo { float:left; width:329px; height: 175px; overflow: hidden; white-space: nowrap; border-left: dotted 1px #030; } #tinmoi .theloai { font-size:18px; background-color:#003300; color:#FFF; padding-top:5px; padding-bottom:5px; clear:left } #tinmoi .theloai a { color:#9C0; text-decoration:none; margin-left:5px; font-size:16px;} #tinmoi .theloai a:hover{ color:#6CC; text-decoration:underline; } #tinmoi .tinmoinhat a { text-de...