Skip to main content

Posts

PHP#23MySQL#19 - Đăng nhập, Session, Thoát user, Xử lý

PHP#22MySQL#18 - Xóa, Sửa TIN & admin index (thể loại, loại tin)

//tin.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> </head> <body> <?php if(isset($_GET['lang'])) $lang=$_GET['lang'];   else $lang="vi"; ?> <form id="form1" name="form1" method="get" action="">   <p>     <label for="lang">Ngon ngu:</label>     <select name="lang" id="lang" onchange="form1.submit()">       <option value="vi">Viet</option>       <option value="en" <?php if($lang=="en") echo "selected";?>>English</option>     </select>   <...

PHP#21MySQL#17 - Upload, Xử lý, Thư viện, chèn Ckeditor

//upload.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  charset="utf-8" /> <title>Untitled Document</title> <script type="text/javascript" src="ckeditor/ckeditor.js"></script> </head> <body> <form action="process.php" method="post" enctype="multipart/form-data" name="form1" id="form1">   <p>     <label for="upImg">Chon anh:</label>     <input type="file" name="upImg" id="upImg" />   </p>   <p>     <label for="MoTa">Mo ta:</label>     <textarea name="MoTa" id="MoTa" cols="45" rows="5" class="ckeditor"></textarea>   </...

PHP#21MySQL#17 - tin_them.php, process.php - Thêm tin mới, Xử lý tin mới

 //tin_them.php <!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript" src="ckeditor/ckeditor.js"></script> </head> <body> <?php include("../connect.php"); if(isset($_GET['lang'])) $lang=$_GET['lang']; else $lang='vi'; ?> <form id="form1" name="form1" method="get" action=""> <p> <label for="lang">Ngon ngu:</label> <select name="lang" id="lang" onchange="form1.submit();"> <option value="vi">Viet</option> <option value="en" <?php if($lang=='en') echo "selected='selected'";?>>Anh</option> </select> </p> <p> <l...

PHP#20MySQL#16 - upfiles.php

 <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <form method="post" enctype="multipart/form-data" name="form1" id="form1">   <input type="hidden" name="MAX_FILE_SIZE" value="102400"/>   <label for="upfile">File:</label>   <input type="file" name="upfile" id="upfile">   <input type="submit" name="submit" id="submit" value="Submit"> </form> <?php if(isset($_FILES['upfile'])) { //Thư mục để chứa file: $target="files/"; //lấy tên: $filename=basename($_FILES['upfile']['name']); //abc.jpg đang ở c:/hinh/abc.jpg $target=$target.$filename; //kiểm tra file đã có chưa: if(file_exists($target)) echo "File đã tồn tại!"; else echo ...

PHP#20MySQL#16 - tin.php : Lọc tin theo Ngôn ngữ, Thể loại, Loại & Phân trang

//tin.php  <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <style> .ht{ font-weight: bold; color:#E80206; font-size:20px;} </style> </head> <body> <?php include("../connect.php");  if(isset($_GET['lang'])) $lang=$_GET['lang']; else $lang="vi"; ?> <form method="get" id="form1" name="form1" action="">   <p>     <label for="idTL">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>   <p>     <label for="idTL">Thể loại:</label>     <select name=...

PHP#20MySQL#16 - Xóa LOẠI TIN

//loaitin.php (phần Xóa) <!doctype html> <html> <head> <meta charset="utf-8"> <title>Loại Tin</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="loaitin">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>   <p>     <label for="theloai">Thể loại:</label>     <select name="theloai" id="theloai" onChange="form1.submit();"> <?php  ...