求聖人幫忙寫幾句簡單的驗證

來源:互聯網
上載者:User
求高人幫忙寫幾句簡單的驗證
我有一個站,有10來個html的檔案,

現在想把加密授權使用。

應該怎麼寫來實現呢。

我百度裡抄了個,單獨命名了m.php

現在怎麼讓首頁index.html能先載入m.php驗證正確了,再繼續執行顯示正確的代碼


------解決方案--------------------
把你的html改成php,然後在最頂,加上include('m.php'); 就可以了。
m.php

$username = isset($_GET['username'])? $_GET['username'] : '';
$password = isset($_GET['password'])? $_GET['password'] : '';

if($username!='fdipzone'
------解決方案--------------------
$password!='123456'){
exit('no permission');
}
?>

index.php

include('m.php');
?>



index



index page




http://localhost/index.php 會顯示no permission
http://localhost/index.php?username=fdipzone&password=123456 顯示index.php的內容。
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.