string strr = Session["sid"].ToString();
Session["user"] = null;
if (Session["user"] != null)
{
.........
}
else
{
Response.Write("<script>alert('尚未登录,请登录后再下载'</script>");
Response.Redirect("http://192.168.100.111/12/upload/forum.php");
}当我点击下载的时候 走else 跳转到登录页。 但是登录页是php做的 我如何能获取到Session
然后走if()...
求大神帮忙解决 最好有代码。。
如果有其它方案 也请附加代码。 谢谢
Session["user"] = null;
if (Session["user"] != null)
{
.........
}
else
{
Response.Write("<script>alert('尚未登录,请登录后再下载'</script>");
Response.Redirect("http://192.168.100.111/12/upload/forum.php");
}当我点击下载的时候 走else 跳转到登录页。 但是登录页是php做的 我如何能获取到Session
然后走if()...
求大神帮忙解决 最好有代码。。
如果有其它方案 也请附加代码。 谢谢
define('CURSCRIPT', 'forum');
require './source/class/class_core.php';
require './source/function/function_forum.php';$modarray = array('ajax','announcement','attachment','forumdisplay',
'group','image','index','medal','misc','modcp','notice','post','redirect',
'relatekw','relatethread','rss','topicadmin','trade','viewthread','tag','collection','guide'
);$modcachelist = array(
'index' => array('announcements', 'onlinelist', 'forumlinks',
'heats', 'historyposts', 'onlinerecord', 'userstats', 'diytemplatenameforum'),
'forumdisplay' => array('smilies', 'announcements_forum', 'globalstick', 'forums',
'onlinelist', 'forumstick', 'threadtable_info', 'threadtableids', 'stamps', 'diytemplatenameforum'),
'viewthread' => array('smilies', 'smileytypes', 'forums', 'usergroups',
'stamps', 'bbcodes', 'smilies', 'custominfo', 'groupicon', 'stamps',
'threadtableids', 'threadtable_info', 'posttable_info', 'diytemplatenameforum'),
'redirect' => array('threadtableids', 'threadtable_info', 'posttable_info'),
'post' => array('bbcodes_display', 'bbcodes', 'smileycodes', 'smilies', 'smileytypes',
'domainwhitelist', 'albumcategory'),
'space' => array('fields_required', 'fields_optional', 'custominfo'),
'group' => array('grouptype', 'diytemplatenamegroup'),
);$mod = !in_array(C::app()->var['mod'], $modarray) ? 'index' : C::app()->var['mod'];define('CURMODULE', $mod);
$cachelist = array();
if(isset($modcachelist[CURMODULE])) {
$cachelist = $modcachelist[CURMODULE];
}
if(C::app()->var['mod'] == 'group') {
$_G['basescript'] = 'group';
}C::app()->cachelist = $cachelist;
C::app()->init();loadforum();
set_rssauth();
runhooks();
$navtitle = str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']['forum']);require DISCUZ_ROOT.'./source/module/forum/forum_'.$mod.'.php';?>php代码 我不懂 你看下那块是登录啊?
php是否也可以用stateServer呢??
像你这种情况,最好是放在数据库中
if (Session["user"] != null)
{
.........
}
else
{
Response.Write("<script>alert('尚未登录,请登录后再下载'); window.location.href='http://192.168.100.111/12/upload/forum.php'</script>");
Response.End();
}