HTML一些有趣的東西


1、<head>標簽里:

<meta http-equiv="Refresh" content="3"/><!--三秒自動刷新-->

 

<meta http-equiv="Refresh" content="3;Url=http://www.baidu.com"/><!--三秒自動跳轉網站-->

 

<meta name="Keywords" content="東小東,東小東啦啦,東小東很氣憤,東小東要努力"/><!--關鍵字搜索,百度檢索就找此-->


<meta name="Description" content="東小東是一個不怎么樣的孩子,但他很不努力,所以一事無成,一無所有,一敗塗地,哈哈"/><!--摘要,描述-->

 

<link rel="shortcut icon" type="image/jpg" href="img/2.jpg" /><!--title的小圖標    type可有多種值 gif/jpg/png/ico等 -->

<!--畫一條橫線--><hr>

 頁面內容不可被選中(不可擴選復制)

body{
    -webkit-user-select:none;
    -moz-user-select:none;
    -ms-user-select:none;
    user-select:none;
}    

 

2、小小程序,PHP實現文件上傳一體化實現程序,頁面要提交簡單驗證碼以示用戶身份,保證上傳信息安全:

<img src="img/0.jpg"/>
<form enctype="multipart/form-data" action="" method="post">
選 擇 上傳文件: <input type="file" name="img" /><br/><br/>
輸入唯一驗證碼:<input type="password" name="yzm"/><br/><br/>
&nbsp;&nbsp;&nbsp;<input type="submit" value="開始上傳"/>
</form>
<?php
if(isset($_POST["yzm"])){
$yzm=trim($_POST["yzm"]);
if($yzm=="驗證碼"){
class Test{
public static function main(){
if(!empty($_FILES)){
$test=new Test();
$test->uploadImg();
exit;
}
}
public function uploadImg(){
$fi=$_FILES['img'];
$finame=$fi['name'];
$res=move_uploaded_file($fi['tmp_name'],'file/'.trim(iconv("utf-8","gbk",$finame)));
if($res){
echo "------文件{ ".trim($finame)." }上傳成功---------------";
}else{
echo "!!文件{ ".trim($finame)." }上傳失敗【2】!!";
}
}
}
Test::main();
}else{
echo "!!文件上傳失敗【1】!!";
}
}
?>

頁面還沒做啥美化,哈哈

更多詳情可參考:

https://www.cnblogs.com/dongxiaodong/p/10066333.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM