I found information on the Internet, which is more reliable,
JS Code:
Copy Co De
<Script language = "javasExport "src =" {Dede: Global name = 'cfg _ cmspath '/}/include/dedeajax2.js "> </SCRIPT>
<Script language = "javasOther ">
Function checkuser (){
VaR taget_obj = Document. getelementbyidx_x ('_ userboxform ');
Myajax = new dedeajax (taget_obj, false, false ,"","","");
Myajax. sendget2 ("{Dede: Global name =" cfg_memberurl "/}/userboxsta. php ");
Dedexhttp = NULL;
}
</SCRIPT>
Then we modify the code on the Content Page.
Find:
<Div>
<DL>
<Dd class = "MTop">
<Strong> User name: </strong> <input name = "username" class = "username" type = "text" maxlength = "20"/>
<Strong> password: </strong> <input name = "PWD" class = "password" type = "password" maxlength = "20"/>
</DD>
Modify it
<Div class = "userbox">
<DL>
<Dd class = "MTop">
<Span id = "_ userboxform">
<Strong> User name: </strong> <input name = "username" class = "username" type = "text" maxlength = "20"/>
<Strong> password: </strong> <input name = "PWD" class = "password" type = "password" maxlength = "20"/>
</Span>
</DD>
<Span id = "_ userboxform"> is added to determine whether the user has logged on.
Next we will write a PHP file. The user transfers the data and saves it as/member/userboxsta. php. The Code is as follows:
Copy Co De
<? PHP
Header ("Pragma: No-Cache \ r \ n ");
Header ("cache-control: No-Cache \ r \ n ");
Header ("expires: 0 \ r \ n ");
Header ("Content-Type: text/html; charset = gb2312 ");
// The system is set to maintenance and accessible.
$ Pai_iscanview = true;
Require_onCe (dirname (_ file _). "/../include/inc_memberlogin.php ");
$ Pai_ml = new memberlogin ();
If (empty ($ cmd_ml-> m_id) {echo ""; exit ();}
$ Uid = $ pai_ml-> m_loginid;
?>
<Strong> welcome </strong> [<? PHP echo $ cmd_ml-> m_username?>], Now you can publish messages directly.
Some silly programmers may find that they are not successful.
1. You need to call it when loading the body onload ..
2. The newly written page
Userboxsta. php does not load the configuration file to the page
Add require_once (dirname (_ file _). "/config. php ");
OK
Require_once (dedeinc. '/memberlogin. Class. php ');
$ Pai_ml = new memberlogin ();
If ($ logs _ml-> islogin ()){
Echo "logged in ";
} Else {
Echo "No Logon ";
}
Http://wenwen.soso.com/z/q453202582.htm