FreeのScriptを使って作成しました。
以下のスクリプトが設定されています。
必ずしもスマートに作られている訳ではありません。まあ、とにかく動作する例です。
var expdate=new Date();
FixCookieDate(expdate);
expdate.setTime (expdate.getTime() + (24*60*60*1000));
con = GetCookie("tomos");
if (con!=null) {
var today = new Date()
if ((Date.parse(today.toGMTString())-Date.parse(con))<(24*60*60*1000)) {
document.write("今日再度こられましたね。<br>")
var someday=new Date(con)
document.write("前回、"+someday.toLocaleString()+"以来のお越しですね")
}
else
document.write("前回、"+con+"以来のお越しですね")
}
else {
var today = new Date()
SetCookie("tomos",today.toGMTString(),expdate);
document.write("初めてのお越しですね")
}
削除するためのJavaScript
function unregister() {
DeleteCookie("tomos")
}
削除ボタンは以下の設定になっています
<form onSubmit="return false;">
<input type="button" value="登録の削除" onClick="unregister();history.go(0)">
</form>