⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 day_cookie.plex

📁 小小程序....请大家慢慢看拉...就是一些关于你学习它的一些练习
💻 PLEX
字号:
use CGI ":standard";

# Get the existing day cookie, if there was one

@last_day = cookie('last_time');

# Get the current date and make the new cookie

$day_of_week = (qw(Sunday Monday Tuesday Wednesday Thursday 
                   Friday Saturday)) [(localtime)[6]];
$month = (qw(January February March April May June July 
          August September October November December))
          [(localtime)[4]];
$day_of_month = (localtime)[3];
@day_stuff = ($day_of_week, $day_of_month, $month); 

$day_cookie = cookie(-name => 'last_time',
                     -value => \@day_stuff,
                     -expires => '+5d');

# Produce the return document
# First, put the cookie in the new header

print header(-cookie => $day_cookie);
print start_html('This is day_cookie.pl');

# If there was no day cookie, this is the first visit
if (scalar(@last_day) == 0) {
    print "Welcome to you on your first visit to our site <br />";
}

# Otherwise, welcome the user back and give the date of the 
#  last visit

else {
    ($day_of_week, $day_of_month, $month) = @last_day;
    print "Welcome back! <br /> ",
          "Your last visit was on ",
          "$day_of_week, $month $day_of_month <br />";
}

print end_html;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -