楼主将验证function发过来看看, 你数据库中userstate字段是什么啊? varchar, bit ,tinyint? 再试试单引之类的吧,登录验证应该没这么多问题吧
嗯,是的,我把代码贴出来老大帮着看一下,光贴关键代码吧,都贴出来太长了: if ($user->login($username, $password)) { update_user_info(); recalculate_price(); if ($url == 'user.php')我想这个LOGIN就是所需要的函数,所以我就搜索了一下它,把它修改了,它的代码如下: function login($username, $password) { if ($this->check_user($username, $password) > 0) { if ($this->need_sync) { $this->sync($username,$password);
我改了,将这个LOGON函数加上了 "and userstate=1",但好象不起作用。。仍然可以进入。。我改的是ECSHOP的源代码,网上开源的。
我在想是不是这个程序的函数编译过啊,所以不行。。搞不懂了。
你数据库中userstate字段是什么啊? varchar, bit ,tinyint?
再试试单引之类的吧,登录验证应该没这么多问题吧
if ($user->login($username, $password))
{
update_user_info();
recalculate_price();
if ($url == 'user.php')我想这个LOGIN就是所需要的函数,所以我就搜索了一下它,把它修改了,它的代码如下:
function login($username, $password)
{
if ($this->check_user($username, $password) > 0)
{
if ($this->need_sync)
{
$this->sync($username,$password);
我想这里的CHECK_USER应该是最终的验证函数,再找:
{
$sql = "SELECT " . $this->field_id .
" FROM " . $this->table($this->user_table).
" WHERE " . $this->field_name . "='" . $post_username . "' AND " . $this->field_pass . " ='" . $this->compile_password(array('password'=>$password)) . "'"; return $this->db->getOne($sql);
}我把里面的$SQL改掉了,加上了一个USERSTATE=1,不知道是不是这样?
再查一下sync()函数是干嘛的
如果上面两个对sql语句没有多大影响的话,应该是可以直接加上去 and userstate='1'或and userstate=1的