You are on page 1of 5

[PHP] View HTML source

December 1, 2013 7:40 pm | admin Cho mi ngi! Mnh to ra ch ny vi mong mun c cng mi ngi nghin cu su hn v cch view HTML source ca mt website bt k. Rt mong mi ngi tham gia cng mnh v gii bi ton ny. view HTML source ca mt website bt k, c 2 cch thng dng: S dng hm file_get_contents: <?php echo file_get_contents(http://google.com); ?> S dng CURL: <?php $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, http://google.com); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 30); echo curl_exec($ch); curl_close($ch); ?> Vi CURL, bn phi in chnh xc ng dn cui cng ca trang ly HTML (CURL dng x l khi ng dn redirect). C th, nu my tnh ca bn ang dng c xc nh l VN th ng dn ly chnh xc phi l http://www.google.com.vn ch khng th l http://google.com. c 2 cch trn, mi ngi u s d dng ly c HTML source ca Google. Tuy nhin, hy th ly HTML source ca trang ny nh: http://prettytre.net. Ok, vy vn t ra ch ny l: Lm sao c th ly HTML source ca 1 website bt k cho d host c cu hnh chn nh http://prettytre.net? No mi ngi! Bt u tho lun nh! ^^ Tho lun 1: Ch ch, cch ny nhanh gn v li hi hn cch mnh ang lm rt nhiu ln! Tuyt lm! Thanks VnVision nhiu! Bn c th gii thch gip mnh dng ny c khng? curl_setopt ($ch, CURLOPT_HTTPHEADER, array ( Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8, Accept -

Language: en-us,en;q=0.5, Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 )); Tho lun 2: Cng c nhiu trng hp vic ly data t ng i hi nhiu x l phc tp hn l fake cc header ca mt browser. Vd: cc bn th ly danh sch cc game cng s liu progress, trophy trang ny xem: http://us.playstation.com/publictrophy/index.htm?onlinename=robbo1337 (phn d liu cn ly l html source ca mt iframe c chn trong link ny). Tho lun 3: Ch ch, cch ny nhanh gn v li hi hn cch mnh ang lm rt nhiu ln! Tuyt lm! Thanks VnVision nhiu! Bn c th gii thch gip mnh dng ny c khng? curl_setopt ($ch, CURLOPT_HTTPHEADER, array ( Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8, Accept Language: en-us,en;q=0.5, Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 )); Gi HTTP Request Header nh cc browser vn thng gi n :noexpress Tho lun 4: cc bc i cho e hi v thit k web bng html vi Ch cn mt host cho php m HTML l bn c th tin hnh ri y http://www.ddth.com/images/icons/icon1.gif Tho lun 5: Thanks you! My ba trc lang thang th no, my bc website chn, lm em khng file_get_content dc! Tho lun 6: Thanks . Tho lun 7: cc bc i cho e hi v thit k web bng html vi Tho lun 8: Hin ti vi cch ny th mnh hu nh ly c tt c nhng g cn ly trn tt c cc website ri, khng vng bn g c. Nng cao v phc tp hn na l ly HTML ca cc trang redirect hoc fake address. Mnh ang tm cch n gin nht x l 2 vn ny, nu n s trnh by vi mi ngi sau. Tho lun 9: onh du hc hi sau. h h h

Tho lun 10: Nguyn tc l cc html u c server tr v khi c request ln. Nu cc bc ko dng PHP get c th dng View Source ca browser vy Tho lun 11: Ny th chn ny <?php $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, http://prettytre.net); curl_setopt($ch,CURLOPT_USERAGENT,Mozilla/5.0 (Windows; U; Windows NT 5.1; enUS; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13); curl_setopt ($ch, CURLOPT_HTTPHEADER, array ( Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8, AcceptLanguage: en-us,en;q=0.5, Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 )); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); echo curl_exec($ch); curl_close($ch); tham kho thm: http://ddth.com/showthread.php?t=397657 Tho lun 12: Nu browser ly c sao mnh khng th Tho lun 13: iu quan trng khi dng CURL l phi fake cc thng s nh header, cookie, user agent v.v mi mong vt qua c cc trang web , cc bn th lm 1 ng dng login vo Facebook th xem s bit s kh khn! Tm hiu k hn v khn ti : http://www.vatgia.com/868/khan.html To 1 virtual keyboard ging vi virtual keyboard cua window Xem thm Posted in: Uncategorized | Tagged: accept texthtmlapplicationxhtml+xmlapplicationxml;q=09;q=08 acceptlanguage enusen;q=05 acceptcharset, curlopt_httpheader array accept texthtmlapplicationxhtml+xmlapplicationxml;q=09;q=08 acceptlanguage, html source ca, texthtmlapplicationxhtml+xmlapplicationxml;q=09;q=08 acceptlanguage enusen;q=05 acceptcharset iso88591utf8;q=07;q=07, view html source Comments are closed. Previous Post Next Post
Search

Pages

Sample Page

Categories

Bt ng sn Cng nghip, xy dng Dch v, gii tr, du lch Hng thi trang Khc My nh, my quay My tnh, linh kin M & b Ni tht, ngoi tht t, xe my, xe p Sch, vn phng Sc khe, sc p Thc phm, ung Uncategorized in thoi, vin thng in t, gia dng dng sinh hot

Archives

December 2013 November 2013 October 2013 April 2013

Calendar
December 2013 M T W T F S S Nov 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Recent Posts

Li hon thnh nv m ko nhn c xu kha Bentley Powerrebar v8i Cn mua Jiupiter V LIMITED (hoc jiu v khc) vnh c fanh a cng tt(ABC cng c)

H thng h tr mi bn China giup minh voi , may vi tinh cua minh co van de roi?

Tag Cloud
hdvnbits forum hdvnbits forum posted > <o > <o > activated users can see activated users can see links] and activated users can and activated users can see bn c th bp hng ngoi chy cha chy cung cp dch v cc bn c th c nhu cu lun tho lun ngi ph n phim hot hnh
phng chy cha phng chy cha chy registered and activated users

registered and activated users

can tho lun cho tho lun hay tho lun originally posted tho lun tho lun tho lun truyn tt c cc v my bay
[only registered and activated users iu khin t mc my

About Chiron
Chiron is a beautiful theme to enhance the look and functionality of your website. It is a clean and minimalist theme that is ideal for blogs, magazines and portfolios. It supports custom header, custom background, custom menus and widgets. We believe you will like this.

Blogroll Meta

Log in Entries RSS Comments RSS WordPress.org

Copyright 2013 - http://ingiaymoi.com Theme Chiron by WPJournals WordPress

You might also like