復制代碼 代碼如下:
<form action="URL">
<input type="text">
<input type="password">
<input type="submit" value="login">
</form>
復制代碼 代碼如下:
<?php
// 檢查用戶名及口令
if ($username == 'kevin' and $password == 'secret')
$authorized = true;
?>
<?php if (!$authorized): ?>
<!-- 未授權的用戶將在這里給予提示 -->
<p>Please enter your username and password:</p>
<form action="<?=$PHP_SELF?>" method="POST">
<p>Username: <input type="text" /><br />
Password: <input type="password" /><br />
<input type="submit" /></p>
</form>
<?php else: ?>
<!-- 有安全要求的HTML內容 -->
<?php endif; ?>
復制代碼 代碼如下:
<?php
if ( !ini_get("register_globals") )
{
extract($_POST);
extract($_GET);
extract($_SERVER);
extract($_FILES);
extract($_ENV);
extract($_COOKIE);
if ( isset($_SESSION) )
{
extract($_SESSION);
}
}
?>
新聞熱點
疑難解答