導航:首頁 > 編程語言 > php746

php746

發布時間:2022-07-13 20:24:44

php網頁如果需要查看信息必須輸入密碼,驗證後才可顯示出內容的代碼如何實現啊

新建一個PHP文件如下:

<?php
header('Content-type:text/html;charset=utf-8');
$password = "1234"; // 這里是正確密碼
$p = "";
if(isset($_COOKIE["isview"]) && $_COOKIE["isview"] == $password){
$isview = true;
}else{
if(isset($_POST["pwd"])){
if($_POST["pwd"] == $password){
setcookie("isview",$_POST["pwd"],time()+3600*0.2);
$isview = true;
}else{
$p = (empty($_POST["pwd"])) ? "需要密碼才能查看,請輸入密碼。" : "密碼不正確,請重新輸入。";
}
}else{
$isview = false;
$p = "請輸入密碼查看,獲取密碼可聯系我。";
}
}

if($isview){ ?>

密碼成功顯示的內容

<?php }else{ ?>
<!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" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<title>測試</title>
<!--[if lt IE 6]>
<style type="text/css">
.z3_ie_fix{
float:left;
}
</style>
<![endif]-->
<style type="text/css">
<!--
body{
background:none;
}
.passport{
border:1px solid red;
background-color:#FFFFCC;
width:400px;
height:100px;
position:absolute;
left:49.9%;
top:49.9%;
margin-left:-200px;
margin-top:-55px;
font-size:14px;
text-align:center;
line-height:30px;
color:#746A6A;
}
-->
</style>
<div class="passport">
<div style="padding-top:20px;">
<form action="" method="post" style="margin:0px;">輸入查看密碼
<input type="password" name="pwd" /> <input type="submit" value="查看" />
</form>
<?php echo $p; ?>
</div>
</div>
</body>
</html>
<?php
} ?>

② 出現dede保存目錄數據時失敗,請檢查你的輸入資料是否存在問題!後執行了9個SQL語句但是之成功了6個 如下:

INSERT INTO `dede_sysconfig` (`aid`, `varname`, `info`, `groupid`, `type`, `value`) VALUES (746, 'cfg_album_mark', '圖集是否使用水印(小圖也會受影響)', 3, 'bool', 'N')

這句錯誤在於該表設置了主鍵,該欄位不允許插入重復的值

ALTER TABLE `dede_arctype` ADD `seotitle` VARCHAR( 80 ) NOT NULL DEFAULT ''

表中已存在列名 seotitle ,故加列失敗

ALTER TABLE `dede_tagindex` ADD `typeid` SMALLINT( 5 ) UNSIGNED DEFAULT '0' NOT NULL

表中已存在列名 typeid,故加列失敗

③ PHP網頁如果需要查看信息必須輸入密碼,驗證後才可顯示出內容的代碼如何實現

相關代碼如下:

④ php session存在哪個文件夾

session不存文件夾 session是一個網頁的緩存 你只要清一下網頁的緩存就會沒有 所以session是沒有文件夾的

⑤ 打開網站後出現這樣Parse error: syntax error,

這個意思是
在function.php的第746行
你有一個字元【/】的格式錯誤,或者不該出現這個字元
你可以檢查一下那個php是怎麼回事,你最近做過什麼修改
希望能幫助到你

⑥ 偷星九月天266回

偷星九月天266 267回https://gss0..com/70cFfyinKgQFm2e88IuM_a/forum/pic/item/.jpg https://gss0..com/70cFfyinKgQFm2e88IuM_a/forum/pic/item/.jpg https://gss0..com/70cFfyinKgQFm2e88IuM_a/forum/pic/item/.jpg https://gss0..com/70cFfyinKgQFm2e88IuM_a/forum/pic/item/.jpg https://gss0..com/70cFfyinKgQFm2e88IuM_a/forum/pic/item/.jpg https://gss0..com/70cFfyinKgQFm2e88IuM_a/forum/pic/item/.jpg https://gss0..com/70cFfyinKgQFm2e88IuM_a/forum/pic/item/.jpg https://gss0..com/70cFfyinKgQFm2e88IuM_a/forum/pic/item/.jpg https://gss0..com/70cFfyinKgQFm2e88IuM_a/forum/pic/item/.jpg https://gss0..com/70cFfyinKgQFm2e88IuM_a/forum/pic/item/.jpg https://gss0..com/70cFfyinKgQFm2e88IuM_a/forum/pic/item/.jpg https://gss0..com/70cFfyinKgQFm2e88IuM_a/forum/pic/item/.jpg

⑦ 求php解密高手,這個php加密的誰能解密

php7.2.3安裝

⑧ php代碼中加一個判斷

<?php
header("Location: http://你的鏈接");
}else{?>

這樣輸正確會直接跳轉到你的鏈接,如果你要先顯示「恭喜你,密碼正確」後再跳轉,就在這句話前面加一個延遲:header("Refresh:3;你的鏈接");

修改後完整代碼:
<?php //輸入密碼後訪問本頁內容
$password = "3210";//這里是密碼
$p = "";if(isset($_COOKIE["isview"]) and $_COOKIE["isview"] == $password){
$isview = true;}else{
if(isset($_POST["pwd"])){
if($_POST["pwd"] == $password){
setcookie("isview",$_POST["pwd"],time()+3600*3);$isview = true;}else{$p = (empty($_POST["pwd"])) ? "需要密碼才能查看,請輸入密碼。" : "<div style=\"color:#F00;\">密碼不正確,請重新輸入。</div>";}
}else{$isview = false;$p = "請輸入密碼查看,獲取密碼可聯系我。";}}?>
<?php if($isview){?>
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>提醒你輸入密碼</title>
<style type="text/css">body{background:none;}.passport{width:400px;position:absolute;left:50%;top:50%;margin-left:-200px;margin-top:-55px;font-size:18px;text-align:center;line-height:30px;color:red;}</style>
</head><body>
<div class="passport">恭喜你!密碼輸入正確</div>
</body></html>
<?php
header("Refresh:3;http://www..com");
}else{?>
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>提醒你輸入密碼</title>
<style type="text/css">body{background:none;}.passport{border:1px solid red;background-color:#FFFFCC;width:400px;height:100px;position:absolute;left:49.9%;top:49.9%;margin-left:-200px;margin-top:-55px;font-size:14px;text-align:center;line-height:30px;color:#746A6A;}</style>
</head><body>
<div class="passport"><div style="padding-top:20px;">
<form action="" method="post" style="margin:0px;">輸入查看密碼
<input type="password" name="pwd" /> <input type="submit" value="查看" />
</form>
<?php echo $p;?>
</div></div>
</body></html>
<?php }?>

閱讀全文

與php746相關的資料

熱點內容
erp是什麼伺服器 瀏覽:182
python中tmp 瀏覽:19
說明wpf加密過程 瀏覽:142
java讀取list 瀏覽:702
iis7gzip壓縮 瀏覽:39
有什麼安卓機打吃雞好 瀏覽:597
三星u盤加密狗 瀏覽:473
php函數的返回值嗎 瀏覽:586
國企穩定程序員 瀏覽:328
編程貓如何使用教程視頻 瀏覽:218
安卓遠端網頁如何打日誌 瀏覽:218
壓縮flash大小 瀏覽:993
解壓的玩具教程可愛版 瀏覽:366
哪個求職app比較靠譜 瀏覽:888
java的讀法 瀏覽:60
nod32區域網伺服器地址 瀏覽:1003
數碼科技解壓 瀏覽:236
新網的雲伺服器管理界面復雜嗎 瀏覽:367
無人聲解壓強迫症視頻 瀏覽:573
計算機編譯運行 瀏覽:640