外部网站调用Uchome用户登录的代码

<form id="loginform" method="post" name="login" action="http://www.homebk.net:8080/home/do.php?ac=login&ref" target="_blank">
   
    <td width="186">用户名:
      <input id="username" name="username" type="text" size="7" class="input" tabindex="2" /></td>
    <td width="186">密码:
      <input type="password" name="password" id="password" size="7" class="input" tabindex="3s" /></td>
    <td width="59" align="right" valign="middle">&nbsp;
     <input type="submit" id="loginsubmit" name="loginsubmit" value="登录" style="width:47px; height:20px; background:url(/resources/images/btnbg.jpg) no-repeat; border:0; cursor:pointer; font-size:12px; color:#FFFFFF; text-align:center;" />
    <input type="hidden" name="formhash" value="d9d21108" />
    <input type="hidden" name="refer" value="/home/space.php?do=home" />
           
    </td>
   
    <td width="47"></td>
   
</form>

 

要注意的是,需要更改两个设置!~

一,找到common.php文件里的登录注册防灌水机这一行,将下面的代码:

  1. if(empty($_SCONFIG['login_action'])) $_SCONFIG['login_action'] = md5('login'.md5($_SCONFIG['sitekey']));
  2. if(empty($_SCONFIG['register_action'])) $_SCONFIG['register_action'] = md5('register'.md5($_SCONFIG['sitekey']));
复制代码

改为:

  1. if(empty($_SCONFIG['login_action'])) $_SCONFIG['login_action'] = 'login';
  2. if(empty($_SCONFIG['register_action'])) $_SCONFIG['register_action'] = 'register';
复制代码

 

二,站外登录的话去掉formhash的判断
/source/function_common.php文件中

&& $_POST['formhash'] == formhash()

复制代码

删除这段代码
不然登录不了

你可能感兴趣的:(home)