HTML一些有趣的東西

一、<head>標籤裏:php

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

 

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

 

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


<meta name="Description" content="東小東是一個不怎麼樣的孩子,但他很不努力,因此一事無成,一無全部,一敗塗地,哈哈"/><!--摘要,描述-->post

 

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

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

 

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

<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】!!";
}
}
?>htm

頁面還沒作啥美化,哈哈blog

更多詳情可參考:

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

相關文章
相關標籤/搜索