麻辣堂|资源主站|开发论坛|在线手册
首页 Apache Linux Java MySQL 注册帮助 
PHP项目开发组是PHP开发资源网于2007组年建成立的项目开发团队,目前核心开发成员有27人, 项目协作成员8名.下设7个开发组,主要承接大/中型网站项目开发任务。

    由于开发任务较多,人员比较紧张,现面向社会招聘全职或者兼职开发人员,不管你是在校大学生,还是全职开发人员,以及SOHO都可以联系本站,我们可以长期合作,并为您带来丰厚的报酬。
  您现在的位置:PHP开发资源网 > 麻辣堂 > 详细资料
待解决
一个关于session的问题的解决
悬赏分:20 - 2007年08月22日

以下代码程序出现warning! [php] <? //error_reporting(E_ALL); include "../config/config.ini.php"; include "../include/func.php"; include "../include/header.html"; if (empty($func)) $func = "show_login"; ?> <? if ($func == "show_login") { echo "
"; table_start(774, "myadmin"); form_start("$PHP_SELF?func=test_login"); input("text", "name", "user", 20); input("password", "password", "password", 20); form_end(); table_end(); echo "
"; } if ($func == "test_login") { if(empty($user)) { $telerror="No username!"; error_msg("$telerror",""); } if(empty($password)) { $telerror="No password!"; error_msg("$telerror",""); } $user=trim($user); $password=trim($password); $result=mysql_query("select * from admin where user='$user' and password='$password'"); if(empty($result)) { Session_Start(); $_SESSION = array(); session_destroy(); } else { Session_Start(); $_SESSION['adminname']=$user; redirect("./index.php"); } } ?> <? include "../include/footer.html"; ?> [/php] 下面的就没有 [php]<? Session_Start(); //error_reporting(E_ALL); include "../config/config.ini.php"; include "../include/func.php"; include "../include/header.html"; if (empty($func)) $func = "show_login"; ?> <? if ($func == "show_login") { echo "
"; table_start(774, "myadmin"); form_start("$PHP_SELF?func=test_login"); input("text", "name", "user", 20); input("password", "password", "password", 20); form_end(); table_end(); echo "
"; } if ($func == "test_login") { if(empty($user)) { $telerror="No username!"; error_msg("$telerror",""); } if(empty($password)) { $telerror="No password!"; error_msg("$telerror",""); } $user=trim($user); $password=trim($password); $result=mysql_query("select * from admin where user='$user' and password='$password'"); if(empty($result)) { Session_Start(); $_SESSION = array(); session_destroy(); } else { $_SESSION['adminname']=$user; redirect("./index.php"); } } ?> <? include "../include/footer.html"; ?> [/php]

提问者:c1a1o1   08-22 08:08
答复
路过。。。顺便帮顶:)
回答者:玉米づ冰冻可乐 - 瓦岗村民 8-22 09:10
我也来回答:
不管你有没有帮助我们,瓦岗寨8万村民将感谢你。。。。。

为防止灌水,您需要计算一道数学题: 答案:
73 + 10 = ? 请将计算结果填在上面

 
[]
©2007 PhpRes.COM