|
<?
session_start();
header( "Content-Type: text/html; Charset=shift_jis" );
header( "pragma: no-cache" );
header( "Expires: Wed, 31 May 2000 14:59:58 GMT" );
header( "Cache-control: no-cache" );
foreach( $_GET as $Key => $Value ) {
$_POST[$Key] = $_GET[$Key];
}
foreach( $_POST as $Key => $Value ) {
$_POST[$Key] = str_replace("\\\\", "\\", $Value );
$_POST[$Key] = str_replace("\\'", "'", $_POST[$Key] );
$_POST[$Key] = str_replace("\\\"", "\"", $_POST[$Key] );
}
if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
if ( $_POST['send'] == 'ログイン' ) {
$_SESSION['user'] = 'lightbox';
}
if ( $_POST['send'] == 'ログアウト' ) {
$_SESSION['user'] = '';
}
header( "Location: ./Main.htm" );
exit();
}
print "<pre>";
print_r($_SESSION);
print "</pre>";
?>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
<TITLE>HTML テンプレート</TITLE>
<STYLE type="text/css">
* {
font-family: "MS Pゴシック";
font-size: 12px;
}
BODY {
background-color: forestgreen;
color: white;
}
</STYLE>
<SCRIPT language="javascript" type="text/javascript">
// *********************************************************
// フォームのチェック
// *********************************************************
function CheckData() {
return true;
}
</SCRIPT>
</HEAD>
<BODY>
<h3>ログイン</h3>
<FORM
name="frmMain"
method="POST"
onSubmit='return CheckData()'
>
<INPUT name="send" type="submit" value="ログイン">
<INPUT name="send" type="submit" value="ログアウト">
</FORM>
</BODY>
</HTML>
| |