Sl. The Add (' gotopage=/'+ Edit59. Text +'/index. PHP ');
Sl. The Add (' dopost=login ');
Sl. The Add (' adminstyle=newdedecms');
Sl. The Add (' userid='+ Edit57. Text);
Sl. The Add (' PWD='+ Edit58. Text);
Sl. The Add (sm1 '=');
S:=dgHTTP. Post (' http://'+ txtWWW. Lines [I] +'/dede/login. PHP ', sl);
If pos (' successful login 's) & gt; 0 then
The begin
//login success came in here! Execute the following code returns when landing interface code
S:=dgHTTP. Get (' http://localhost/dede/index.php ');
Here s return code and landing interface, don't know what reason be?
, return to log in successfully after the POST, but after log in successfully, and Get back home, return code is landing interface, feel like cookies did not remember, but have set up: dgHTTP. AllowCookies:=true;
Use the code below to reset the cookies also not line:
SCookie:=';
For k:=0 to dgHTTP. Response. RawHeaders. Do the Count - 1
The begin
If UpperCase (Copy (dgHTTP. Response. RawHeaders [k], 1, 10))='SET - cookies then
The begin
SCookieTmp:=Trim (Copy (dgHTTP. Response. RawHeaders [k], 12, MAXINT));
SCookieTmp:=Copy (sCookieTmp, 1, Pos ('; ', sCookieTmp) - 1);
SCookie:=sCookie + sCookieTmp + '; ';
end;
end;
SCookie:=sCookie + 'menuitems=1 _1, 2 _1, 3 _1. ';
DgHTTP. Request. CustomHeaders. The Add (+ sCookie cookies:);
CodePudding user response:
Login successful code:
DedeCMS prompt information & lt;/title>
<meta HTTP - equiv="content-type" Content="text/HTML. Charset=gb2312 "/& gt;
<script>
Var pgo=0;
The function JumpUrl () {
If (pgo==0) {location='/dede/index. PHP'; Pgo=1; }
}
Document. Write (" & lt; Br/& gt; Document. Write (" & lt; Div style='height: 130 px; The font - size: 10 pt; Background: # FFFFFF '& gt;
Document. Write (" a successful login, are turning to management management homepage!" );
Document. Write (" & lt; Br/& gt;
" );
SetTimeout (' JumpUrl () ', 1000); </script>
And then request the background main interface code:
<meta HTTP - equiv="content-type" Content="text/HTML. Charset=gb2312 "& gt;Weave the dream content management system V57_GBK_SP1 & lt;/title> <script SRC="https://bbs.csdn.net/include/js/jquery/jquery.js" language="javascript" type="text/javascript" & gt; </script> $=jQuery;
The function changeAuthCode () {
Var num=new Date (). GetTime ();
Var rand=Math. Round (Math. The random () * 10000);
Num=num + rand.
$(' # ver_code). CSS (' visibility ', 'visible');
If ($(" # vdimgck ") [0]) {
$(" # vdimgck ") [0]. SRC="https://bbs.csdn.net/include/vdimgck.php? The tag="+ num.
}
return false;
}
</script>
<body>
- User name: & lt;/dt>
- Compact & amp; nbsp; & nbsp; Code: & lt;/dt>
- & nbsp;
Login & lt;/button>