且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法登录-且没有错误消息.-PHP

更新时间:2023-01-27 21:37:56

在代码顶部添加 session_start(); ;这是因为除非会话开始并且您的 $ _ SESSION ['user_name'] = $ user_name; 当前不执行任何操作,否则您无法保存会话变量.

Add session_start(); at the top of your code; it's because you can't save a session variable unless the session is started and your $_SESSION['user_name']=$user_name; doesn't do anything currently.

您的代码容易受到SQL注入攻击,请阅读

And your code is vulnerable to SQL injection attacks, read this question on how to prevent them.