罪と罰++二律背反

&get_time;                      # 日時取得
&axs_check;                     # アクセスチェック
&read_data_index;       # ログデータ読み込み

&cookie_get;    # クッキー取得
  • 		print <<"EOM";
    ユーザーID:<input type="text" name="id" value="$ck_id" class="button1" style="width:95px">
    <br>
    パスワード:<input type="password" name="pw" value="$ck_pw" class="button1" style="width:60px" maxlength="8">
    <input type="submit" value="IN" class="button1" style="width:30px">
    <input type="hidden" name="mode" value="1">
	$bmes="最新情報 ◎ $wr_mes\n" if $wr_mes;

	$data_reset = int(($cn1+$cn2+$cn3+$cn4+$cn5) * $reset_point);

        #---------------------------------------------ここから追加 
	@exp = split(/ /, (gmtime(time()+30*24*3600)));
	$expire = sprintf("%s, %02d-%s-%4d %s GMT", $exp[0], $exp[2], $exp[1], $exp[4], $exp[3]);
	print "Set-Cookie: id=$id expires=$expire\n";
	print "Set-Cookie: pw=$pw expires=$expire\n";
        #---------------------------------------------ここまで追加 

}

#-------------------------------------------------------------------------------
# ファイル OUT 関連
#---------------------------------------------ここから追加 
# COOKIE
sub cookie_get {
        if($ENV{'HTTP_COOKIE'}){
                *cookie = getCookie($ENV{'HTTP_COOKIE'});
                $ck_id = $cookie{'id'};
                $ck_pw = $cookie{'pw'};
        }
}

sub getCookie {
        local($cookie) = $ENV{'HTTP_COOKIE'};
        local(*data, @cookie);
        @cookie = split(/ /,$cookie);
        foreach(@cookie){
                local($name, $value) = split(/=/);
                $data{$name} = $value;
        }
        return *data;
}
#---------------------------------------------ここまで追加 

1;#削除不可

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2012-06-08 (金) 00:26:00 (4340d)