Skip to main content

Posts

Showing posts from January 18, 2022

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  ...