Jump to content

nguyenbason

Active Members
  • Posts

    107
  • Joined

  • Last visited

About nguyenbason

  • Birthday 06/26/1986

Profile Information

  • Location
    Viet Nam
  • WWW
    http://www.UnderWorldVN.com

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

nguyenbason's Achievements

Adventurer

Adventurer (3/7)

0

Reputation

  1. Anyone have current working version of this wonderful UDF? Seem have problem with _CoProcSend and _CoProcReceive function.
  2. So just check the return, you should read text in <title>...</title> tab to trap your own errors.
  3. Or if you have that file is multiline then you should use _FileReadToArray() then use For...Next and check for "fail" text StringInStr for each array element.
  4. I don't think you need to reply a topic 4 years old.
  5. Sorry if I did not say clearly. I mean how can i get that cookie for each logon user? The above cookie I took from header addon in FF. Query header after user login using Winhttp does not return it.
  6. It does not work If use normal read data with mode 0, i cannot read in console but can read if open saved file (pravda.ru.htm). If you above code, can not read even open this file. Back to previous case about posting to blog. I can post to that page if i set cookie (even don't need to login) $sDataToSend3 = '-----------------------------8723974127529' & @CRLF & _ 'Content-Disposition: form-data; name="classid"' & @CRLF & _ '' & @CRLF & _ '0' & @CRLF & _ '-----------------------------8723974127529' & @CRLF & _ 'Content-Disposition: form-data; name="subject"' & @CRLF & _ '' & @CRLF & _ 'subject 5' & @CRLF & _ '-----------------------------8723974127529' & @CRLF & _ 'Content-Disposition: form-data; name="message"' & @CRLF & _ '' & @CRLF & _ 'message 5<br>' & @CRLF & _ '-----------------------------8723974127529' & @CRLF & _ 'Content-Disposition: form-data; name="tag"' & @CRLF & _ '' & @CRLF & _ 'subject' & @CRLF & _ '-----------------------------8723974127529' & @CRLF & _ 'Content-Disposition: form-data; name="friend"' & @CRLF & _ '' & @CRLF & _ '0' & @CRLF & _ '-----------------------------8723974127529' & @CRLF & _ 'Content-Disposition: form-data; name="password"' & @CRLF & _ '' & @CRLF & _ '' & @CRLF & _ '-----------------------------8723974127529' & @CRLF & _ 'Content-Disposition: form-data; name="noreply"' & @CRLF & _ '' & @CRLF & _ '1' & @CRLF & _ '-----------------------------8723974127529' & @CRLF & _ 'Content-Disposition: form-data; name="selectgroup"' & @CRLF & _ '' & @CRLF & _ '' & @CRLF & _ '-----------------------------8723974127529' & @CRLF & _ 'Content-Disposition: form-data; name="target_names"' & @CRLF & _ '' & @CRLF & _ '' & @CRLF & _ '-----------------------------8723974127529' & @CRLF & _ 'Content-Disposition: form-data; name="blogsubmit"' & @CRLF & _ '' & @CRLF & _ 'true' & @CRLF & _ '-----------------------------8723974127529' & @CRLF & _ 'Content-Disposition: form-data; name="formhash"' & @CRLF & _ '' & @CRLF & _ '60e948de' & @CRLF & _ '-----------------------------8723974127529--' ; New request $hRequest = _WinHttpOpenRequest($hConnect, _ "POST", _ ; verb "cp.php?ac=blog&blogid=", _ ; target "HTTP/1.1", _ ; version "http://space.livevn.com/cp.php?ac=blog", _ ; referer "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") ; accept ; Add some headers _WinHttpAddRequestHeaders($hRequest, "Accept-Language: en-us,en;q=0.5") _WinHttpAddRequestHeaders($hRequest, "Accept-Encoding: gzip,deflate") _WinHttpAddRequestHeaders($hRequest, "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7") _WinHttpAddRequestHeaders($hRequest, "Referer: http://space.livevn.com/cp.php?ac=blog") _WinHttpAddRequestHeaders($hRequest, 'Cookie: __utma=201876307.4095121941824170000.1241451209.1247243241.1247329535.14; __utmz=201876307.1241451209.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); uchome_loginuser=sonnb; uchome_sendmail=1; __utmb=201876307.6.10.1247329535; __utmc=201876307; uchome_auth=a481eVW%2Few6skcBlizkAMMStPUCMAoJUUoWBW%2BkUaKXOTMTVzLgxty2MJl3HIpnI%2BXoW2J8XekcYtjW%2FMak5zEEejQ; uchome_synfriend=1') _WinHttpAddRequestHeaders($hRequest, 'Content-Type: multipart/form-data; boundary=---------------------------8723974127529') ; Send new request _WinHttpSendRequest($hRequest, _ $WINHTTP_NO_ADDITIONAL_HEADERS, _ ; no additional headers (all added above) $sDataToSend3) ; data ; Wait for the response _WinHttpReceiveResponse($hRequest) ; See what's returned If _WinHttpQueryDataAvailable($hRequest) Then $sHeader = _WinHttpQueryHeaders($hRequest) ConsoleWrite($sHeader & @CRLF) Global $sChunk, $sData While 1 $sChunk = _WinHttpReadData($hRequest, 1) If @error Then ExitLoop $sData &= $sChunk WEnd ConsoleWrite($sData & @CRLF) ;#cs ; Write it somewhere to see what's that Global $sFile = @DesktopDir & "\ReturnedPage.htm" Global $hFile = FileOpen($sFile, 2) FileWrite($hFile, $sData) FileClose($hFile) ;#ce Else MsgBox(48, "Error 2", "Site is experiencing problems.") EndIf ; Close open handles _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) ; The end Exit And the user posted these posts always are sonnb. I tried login to another account and copy cookie but seem doesnot work. How can i get these like cookie for each login username and set to header for correctly posting? Thanks
  7. Another question Trancexx, I use _WinHttpReadData to read source of a website in Russian but it return ???? for all Russian characters. Anyway to read correct texts in Russian? Thanks.
  8. Thanks Trancexx for the truth But your answer is the most important even it does not work. Thanks for your wonderful help.
  9. What do you want to do? You are assigning value for $result that taking from WMI query? You want to separate each value or what? $result = $result & $obj.$property & "|"
  10. Hi Trancexx, With your help above, i can login now with following code: #include "WinHTTP.au3" $sUsername = "xxx" $sPassword = "yyy" $sAddress = "space.livevn.com" $hOpen = _WinHttpOpen("Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.0.3; .NET CLR 2.0.50727; ffco7) Gecko/2008092417 Firefox/3.0.3") $hConnect = _WinHttpConnect($hOpen, $sAddress) ;Login $hRequest = _WinHttpOpenRequest($hConnect, "POST", "/do.php?ac=71ee30ae117cddace55bd01714904227&&ref", "HTTP/1.1", "http://space.livevn.com/index.php", "*/*") _WinHttpSendRequest($hRequest, _ "Content-Type: application/x-www-form-urlencoded"& @CRLF, _; <- cookie here? "username=" & $sUsername & "&password=" & $sPassword & "&loginsubmit=&loginsubmit=loginnnnnnnnnnn&refer=network.html&formhash=c51a94db") _WinHttpReceiveResponse($hRequest) If _WinHttpQueryDataAvailable($hRequest) Then Global $sHeader = _WinHttpQueryHeaders($hRequest) If StringInStr($sHeader,'Set-Cookie: uchome_loginuser=' & $sUsername) Then MsgBox(0,"","Login success") Else MsgBox(0,"","Login failed") EndIf Else MsgBox(48, "Error", "Site is experiencing problems.") EndIf And now i want to post new post to blog. But i don't know how to get post url like post url login that you gave. The form code i posted on above post. $subject = "testttt" $msg = "tttest" $hRequest = _WinHttpOpenRequest($hConnect, "POST", "/cp.php?ac=blog&blogid=", "HTTP/1.1", "http://space.livevn.com/cp.php?ac=blog", "*/*") _WinHttpSendRequest($hRequest, _ "Content-Type: application/x-www-form-urlencoded"& @CRLF, _ ;i dont know how to post here with that form) _WinHttpReceiveResponse($hRequest) If _WinHttpQueryDataAvailable($hRequest) Then Global $sHeader = _WinHttpQueryHeaders($hRequest) ConsoleWrite($sHeader & @CRLF & @CRLF) Global $sChunk, $sData, $extended While 1 $sChunk = _WinHttpReadData($hRequest, 1) If @error Then ExitLoop $sData &= $sChunk WEnd ConsoleWrite($sData & @CRLF) Else MsgBox(48, "Error", "Site is experiencing problems.") EndIf Thanks Trancexx,
  11. Hi Trancexx , How can i submit this form? <div class="c_form"> <form enctype="multipart/form-data" action="cp.php?ac=blog&amp;blogid=" method="post"> <table width="100%" cellspacing="4" cellpadding="4" class="infotable"> <tbody><tr> <td> <select onchange="addSort(this)" id="classid" name="classid"> <option value="0">Chọn phân loại</option> <option style="color: red;" value="addoption">+ phân loại mới</option></select> <input type="text" onblur="relatekw();" size="60" value="" name="subject" id="subject" class="t_input"/> </td> </tr> <tr> <td> <textarea style="border: 0px none ; height: 100%; width: 100%; display: none;" id="uchome-ttHtmlEditor" name="message" class="userData"/> <iframe scrolling="no" height="400" frameborder="0" style="border: 1px solid rgb(197, 197, 197); width: 100%;" border="0" id="uchome-ifrHtmlEditor" name="uchome-ifrHtmlEditor" src="editor.php?charset=utf-8&amp;allowhtml="/> </td> </tr> </tbody></table> <table width="100%" cellspacing="4" cellpadding="4" class="infotable"> <tbody><tr> <th width="100">Tag</th> <td><input type="text" value="" name="tag" id="tag" size="40" class="t_input"/> <input type="button" onclick="relatekw();" class="button" value="Tự động nhận" name="clickbutton[]"/></td> </tr> <tr> <th>Thiết lập cá nhân</th> <td> <select onchange="passwordShow(this.value);" name="friend"> <option value="0">Mọi người dùng đều có thể xem</option> <option value="1">Tất cả bạn bè đều có thể xem</option> <option value="2">Chỉ bạn bè chỉ định mới có thể xem</option> <option value="3">Chỉ bản thân mới có thể xem</option> <option value="4">Xem dựa vào mật khẩu</option> </select> <span style="display: none;" id="span_password">Mật khẩu:<input type="text" size="10" value="" name="password"/></span> <input type="checkbox" value="1" name="noreply"/> Không cho phép bình luận </td> </tr> </tbody><tbody style="display: none;" id="tb_selectgroup"> <tr> <th>Bạn bè chỉ định</th> <td><select onchange="getgroup(this.value);" name="selectgroup"> <option value="">Chọn bạn từ trong nhóm bạn bè</option> <option value="0">Khác</option> <option value="1">Quen thông qua trang này</option> <option value="2">Quen thông qua hoạt động</option> <option value="3">Quen thông qua bạn bè</option> <option value="4">Người thân</option> <option value="5">Đồng nghiệp</option> <option value="6">Bạn học</option> <option value="7">Không quen</option> </select> Chọn nhiều lần sẽ tích luỹ vào danh sách bạn bè bên dưới</td> </tr> <tr> <th> </th> <td> <textarea rows="3" style="width: 85%;" id="target_names" name="target_names"/> <br/>(Có thể điền nhiều tên bạn bè, vui lòng dùng khoảng trắng để phân cách)</td> </tr> </tbody> </table> <input type="hidden" value="true" name="blogsubmit"/> <input type="button" style="display: none;" onclick="validate(this);" value="Gửi thông báo" name="blogbutton" id="blogbutton"/> <input type="hidden" value="dd3caa53" name="formhash"/> </form> <table width="100%" cellspacing="4" cellpadding="4" class="infotable"> <tbody><tr><th width="100">Ảnh</th><td> <input type="button" onclick="window.open('cp.php?ac=upload&amp;op=flash')" class="button" value="Upload ảnh" name="clickbutton[]"/> <input type="button" onclick="edit_album_show('album')" class="button" value="Chèn ảnh" name="clickbutton[]"/> </td></tr> </tbody></table> <table width="100%" cellspacing="4" cellpadding="4" style="display: none;" class="infotable" id="uchome-edit-pic"> <tbody><tr> <th width="100"> </th> <td> <strong>Chọn ảnh</strong>: <table cellspacing="2" cellpadding="0" summary="Upload"> <tbody style="display: none;" id="attachbodyhidden"> <tr> <td> <form style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;" target="uploadframe" enctype="multipart/form-data" action="cp.php?ac=upload" id="upload" method="post"> <input type="file" style="border: 1px solid rgb(204, 204, 204);" name="attach"/> <span id="localfile"/> <input type="hidden" value="true" id="uploadsubmit" name="uploadsubmit"/> <input type="hidden" value="0" id="albumid" name="albumid"/> <input type="hidden" value="dd3caa53" name="formhash"/> </form> </td> </tr> </tbody> <tbody id="attachbody"><tr> <td> <form style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;" target="uploadframe" enctype="multipart/form-data" action="cp.php?ac=upload" id="upload_1" method="post"> <input type="file" style="border: 1px solid rgb(204, 204, 204);" name="attach" id="attach_1"/> <span id="localfile_1"/> <input type="hidden" value="true" id="uploadsubmit" name="uploadsubmit"/> <input type="hidden" value="0" id="albumid_1" name="albumid"/> <input type="hidden" value="dd3caa53" name="formhash"/> </form> </td> </tr></tbody> </table> <strong>Lưu vào album</strong>: <table cellspacing="2" cellpadding="0"> <tbody><tr> <td> <select onchange="addSort(this)" id="uploadalbum" name="albumid"> <option value="0">Vui lòng chọn album</option> <option style="color: red;" value="addoption">+ album mới tạo</option> </select> <script type="text/javascript" src="source/script_upload.js"/> <iframe width="0" height="0" frameborder="0" src="about:blank" marginwidth="0" name="uploadframe" id="uploadframe"/> </td> </tr> </tbody></table> </td> </tr> </tbody></table> <table width="100%" cellspacing="4" cellpadding="4" style="display: none;" id="uchome-edit-album" class="infotable"> <tbody><tr> <th width="100"> </th> <td> Chọn album: <select onchange="picView(this.value)" name="view_albumid"> <option value="none">Chọn 1 album</option> <option value="0">Album mặc định</option> </select> (Nhấp vào ảnh để chèn vào nội dung) <div id="albumpic_body"/> </td> </tr> </tbody></table> <table width="100%" cellspacing="4" cellpadding="4" class="infotable"> <tbody><tr> <th width="100"> </th> <td><input type="button" class="submit" value="Lưu bài viết" onclick="document.getElementById('blogbutton').click();" id="issuance"/></td> </tr> </tbody></table> </div>
  12. Very nice Idea! Thanks
  13. Hi Jos, Does this support UTF-8? 'Coz i tried and all unicode text become unreadable and also script cannot run. Am i wrong? Thanks,
  14. Yes, that's what i want and $sHTML = _IEBodyReadHTML($oEditor) is working too. I'm asking myself that why yesterday i tried but i didnot work Thank so much Dale,
  15. Thanks for your reply Dale, But as i said on first post. I can write to it that why i can post to blog. Look at this: You can see editor in my program, my question is: When users write data to this editor, how can i get it to post to blog? Tried but don't work. Can you give a example with above link?
×
×
  • Create New...