|
挂QQ的网页源代码[ASP/PHP/JS]
+ X1 b5 _2 Q( Y
) n9 n' q" H% a9 z' w: Q: T3 T: n: ?7 O# a3 i A
" g5 q u8 \+ J' [' j! [
7 h& f. Q) |9 e1 Y& B' z说明:此代码适合你做网站用,普通朋友可以不用理这个东西!
9 X8 I' l" ^# ?( d2 Q5 K- z
+ ]& k& t+ j0 v( gASP: ' ?4 S, {' b) w
7 @) Y- I% t# I* W, L- [: c+ g0 w0 B
I& L; D. i& x- {8 O- R7 k. v% W# kCODE: [Copy to clipboard] * e( W+ X8 x. H4 O. n: A
<%
$ ?: u4 E! U# H" c3 |dim objXMLHTTP, qq, pwd 3 k2 {( |. h V
+ f, x6 j5 q/ q; v( c$ rqq = "10000" ( Q% H+ X% E' h
pwd = "123456"
6 {* h2 I/ o7 d+ b* |. F$ h0 ~7 W. V
set objXMLHTTP = Server.CreateObject("MSXML2.XMLHTTP.5.0")
+ U; ]+ h p% y0 ]+ DobjXMLHTTP.open "POST", "_blank>http://211.139.167.71/waptest/TWF/qqportal/rela/updateuserinfo.jsp", false 2 ]% s' m C# a6 c% v- m
objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" , z2 ?4 T( m( n3 ~
objXMLHTTP.setRequestHeader "Connection", "Keep-Alive" 0 |, a! C8 o1 s: W# Q1 {2 E; p
objXMLHTTP.send("qq="&qq&"&pwd="&pwd&"&FromWhere=register")
4 Z C3 \. W; g9 }. |, l2 S4 ?; K* c
& D% C/ G% r& q7 V' ~( b, P4 D2 Yif InStr(objXMLHTTP.responseText, "验证失败") then
1 y, b) j6 X1 x8 [+ T# Fresponse.write "登录失败"
, g( O8 U& C% zelse 7 u/ ?- ]% {8 @& |2 A! V, y1 |/ ]
response.write "登录成功" . W8 r# v7 Z( J5 Z, j, K4 r4 n
end if 3 z9 J- r2 ^( @. t
) J3 B; `$ e: q# L, v& }set objXMLHTTP = nothing 8 z. w9 T! K) U$ t1 G/ r: d, |
%> 3 c9 ]. t4 N6 l# c9 z
* Q0 U3 }" x1 {+ x) a8 M4 m$ V# b7 }1 s! P0 q; U* i* A, p7 r# w
! j. |" E) I$ F- k9 p
PHP:
- N9 G3 r( @3 O7 I R( t
/ q# t/ X5 ^% @' l8 _
( L/ s( }3 n! g
- I4 J1 I6 S: {$ m pCODE: [Copy to clipboard] " m/ u% L" f, J! k- C3 r& e# M
<php / m) O& Y. C/ Q! i
$qq = "100000"; //qq号码 1 V' a! w6 ]* \% h+ O
$pwd = "123456"; //密码
! q w5 g9 ?" y/ p, I9 H# w7 m' F
$ch = curl_init(); 4 a* ~# E# E% @# B# G/ M v
' r( U: q: J& ]( A* jcurl_setopt($ch, CURLOPT_URL, "_blank>http://211.139.167.71/waptest/TWF/qqportal/rela/updateuserinfo.jsp"); 8 V* l+ q. `! X' c1 K5 Y$ m# ^
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); //这行是设定curl是否跟随header发送的location, 重要
" |% [. \& u5 Jcurl_setopt($ch, CURLOPT_POST, 1); 4 ]3 H3 A8 e* w
//curl_setopt($ch, "Connection", "Keep-Alive");
/ i% E/ v9 l8 D5 g7 zcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1); " D6 \; S, t5 G l8 E1 b$ o) O: N
curl_setopt($ch, CURLOPT_POSTFIELDS, "qq=".$qq."&pwd=".$pwd."&FromWhere=register");
8 M" P. P# ~* V8 a' `$ K4 \
; Q- _) U7 S& {( z* Z' l$return = curl_exec($ch);
7 Z7 q! T- q- w M/ s* o
1 \, \1 y! v0 x3 k% Y) Pcurl_close($ch);
2 p" w( w$ _( [& l. C' k. V, e g. p0 y9 J5 Z9 }4 b5 P, T
echo strstr($return, "postfield") ? "登录失败" : "登录成功";
; ^) ^3 s, G a3 ]/ Z" w6 r?> 8 U0 V+ \7 R# Z4 ^( v3 H+ w
! c p+ s t( N6 J0 _- p. Z! ~
+ |- M% a3 ?) ~4 j) _# {
$ l) N4 p+ z$ L; Q7 Ejs: + a/ \. H3 E5 _' M! j3 Q1 P3 S
& V8 r0 ` Y, `; `$ Z# |
' ?. C6 L* W2 `( _7 T5 ^+ r: n- h3 Q
CODE: [Copy to clipboard] ( a0 C. I9 h% p% ~2 c* i) {$ M7 l
<script type="text/javascript"> 0 A) ]+ n) t/ o5 k0 ]. D
var qq = "100000"; //qq号码
: K2 s8 g/ I) O3 K+ ]! K" vvar pwd = "123456"; //密码 2 ~& L' S; u+ K
- e- P0 ]0 x* R d% v9 j% V
if (window.XMLHttpRequest) { ; I* N! O9 i' c6 a2 I) [
var x = new XMLHttpRequest();
+ R( G* @% @$ `4 @# ~} else { 7 I; D% l" A) o; L8 {
var MSXML = new Array('MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP');
$ l8 d# \/ t# K! T" r8 V( X3 Qfor(var n = 0; n < MSXML.length; n ++) { 3 P$ R# R1 f& |$ @" c; @- C% ~
try {
0 t1 e5 j5 m1 l, T) S7 V# }% Jvar objXMLHTTP = new ActiveXObject(MSXML[n]); $ b/ S" `% g3 t7 X6 p; w* s
break; % p3 B! N5 A& t" C0 v
} catch(e) { Y# V7 ~& Q% j( G" x+ e T
}
+ {; ]! w$ d; l+ n, {8 Q2 H$ {% P}
" F, g. e; g4 c' t0 w! X% t& b}
9 h2 r& J; t7 l1 [4 @# s8 U" K3 z& Q& g5 X2 M8 Y% Y
objXMLHTTP.open("POST", "_blank>http://211.139.167.71/waptest/TWF/qqportal/rela/updateuserinfo.jsp", false);
' U8 S8 p2 z1 r6 [: ], h/ `" yobjXMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
1 v& |% \2 H7 p$ k+ }& v/ gobjXMLHTTP.setRequestHeader("Connection", "Keep-Alive"); ' v- z) G! x) r
objXMLHTTP.send("qq=" + qq + "&pwd=" + pwd + "&FromWhere=register");
2 g3 R h, ^+ q, ?2 t& {& G) {5 Y3 w2 A# Q# G! l$ Z; w: ?: j
if (objXMLHTTP.responseText.indexOf("验证失败") > 0) { $ j- t0 i* e4 S6 F6 J
alert("登录失败"); " T! R3 C" E& {! z
} else { 3 s1 V" s( A7 v# m9 N( h
alert("等录成功"); ' ~. u3 A: Q- |& I; _* i0 {/ C
}
; I7 L1 r8 j; i# ~& S6 c</script>
7 g4 v3 B- S) M7 T9 j |
|