初次接触CGI,有简单疑问请各位解答!——多谢多谢:)
sub authenticate {
my $username = $query->param('icradiusweb_username');
my $password = $query->param('icradiusweb_password');
return 1 if (&check_existing_session);
$radius->print_debug('No valid session found, so proceeding to login');
if ($username && $password) {
return 1 if (check_new_session($username, $password));
&print_header;
safe_error('Invalid Login');
}
&print_header;
&print_login;
&print_footer;
return 0;
}
我想请问一下,上面一段程序中
if ($username && $password) {
return 1 if (check_new_session($username, $password));
&print_header;
safe_error('Invalid Login');
}
的逻辑跟 if($username && $password) (
if (check_new_session($username,$password))
return 1 ;
else{
&print_header;
safe_error('Invalid Login');
}
)
是否一样?如果不是,那上面一种表达式的逻辑怎么?
另,应工作需要,需要了解GCI的编程,请各位给点意见,有那些书籍比较适合初级入门?多谢多谢!