Plugin load diễn đàn ra trang chủ bằng php

23 bài đăng
15.08.2015 / 12:50
thaian2009
Bài đăng: 709
Member
PHP
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5.  
  6. <title>Untitled Document</title>
  7. </head>
  8.  
  9. <body>
  10.  
  11. <?php
  12. ini_set('max_execution_time', 0);
  13. ini_set('user_agent','Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6');
  14.  
  15. $diachi='cobethoitiet.wap.mu'; //tenwap
  16. $sor='new';
  17. $nick='nhok_con'; //taikhoan
  18. $password=base64_encode('matkhau');
  19. $pass=base64_decode($password);
  20.  
  21.  
  22.  
  23. $url='http://xxx.'.$diachi.'/main.php?id=log&nick='.$nick.'&pass='.$pass.'&rem=1';
  24.  
  25. $cookie=('v=3; __qca=P0-1585199047-1438802163714; _gat=1; _ga=GA1.2.829838804.1435661085; __utmmobile=0xd26871e48aba491d');
  26. $user=('Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6');
  27. function http_login_client($url, $params = "", $cookies_send = "" ){
  28. $cookies = array();
  29. $headers = getallheaders();
  30. $ch = curl_init($url);
  31. $options = array(CURLOPT_POST => 1,
  32. CURLINFO_HEADER_OUT => true,
  33. CURLOPT_POSTFIELDS => $params,
  34. CURLOPT_RETURNTRANSFER => 1,
  35. CURLOPT_HEADER => 1,
  36. CURLOPT_COOKIE => $cookies_send,
  37. CURLOPT_USERAGENT => $headers['User-Agent']
  38. );
  39. curl_setopt_array($ch, $options);
  40. $response = curl_exec($ch);
  41. preg_match_all('/^Set-Cookie: (.*?)=(.*?);/m', $response, $matches);
  42. foreach( $matches[1] as $index => $cookie )
  43. $cookies[$cookie] = $matches[2][$index];
  44. return $cookies;
  45. }
  46. $cookies= http_login_client($url,$cookie,$user);
  47.  
  48.  
  49.  
  50. function url_get_contents($url) {
  51. $data=NULL;
  52. $data=file_get_contents($url);
  53. if($data)
  54. {
  55. preg_match("/<body(.*?)>(.+?)<\/body>/s", $data, $matches);
  56. $data=$matches[2];
  57. }
  58. return $data;
  59. }
  60.  
  61.  
  62. $links='http://xxx.'.$diachi.'/forums.php?id=menu&sor='.$sor.'&ses='.$cookies["ses"];
  63. $nguon= url_get_contents($links);
  64. $html = split('<div class="left">',$nguon);
  65. $html=split('<div class="center">',$html[1]);
  66. $html=$html[0];
  67. $inx=0;
  68. $tten=array();$turl=array();$tname=array();$tso=array();
  69. preg_match_all("/<b>(.+?)<\/b>(.+?)<a href=\"(.+?)\">(.+?)\(([0-9]|[0-9][0-9]|[0-9][0-9][0-9])\)<\/a>/", $html, $matches, PREG_SET_ORDER);
  70.  
  71. foreach ($matches as $val) {
  72. $tten[$inx]= $val[1];
  73. $turl[$inx]= 'http://'.$diachi.$val[3];
  74. $tname[$inx]= $val[4];
  75. $tso[$inx]= $val[5];
  76. $inx=$inx+1;
  77. }
  78.  
  79. for($y=0;$y<count($tten);$y++)
  80. {
  81. echo '<div style="background-color:#efefef">Tên: '.$tten[$y].' ->> <a href="'.$turl[$y].'">'.$tname[$y].'</a> ('.$tso[$y].')</div>';
  82. }
  83.  
  84. ?>
  85.  
  86. </body>
  87. </html>

$diachi='cobethoitiet.wap.mu'; //tenwap

$sor='new';

$nick='nhok_con'; //taikhoan

$password=base64_encode('matkhau');

$pass=base64_decode($password);

--> Sửa thành phương thức get-- password mã hóa md5 hay sha tùy bạn.

for($y=0;$y<count($tten);$y++)

{

echo '<div style="background-color:#efefef">Tên: '.$tten[$y].' ->> <a href="'.$turl[$y].'">'.$tname[$y].'</a> ('.$tso[$y].')</div>';

}

Cái này là render ra màn hình tùy bạn sắp xếp hoặc echo thành file js tùy bạn. ok up lên host dùng. Ai có host thì làm cho ae sử dụng chung :v

Nguồn: http://cobethoitiet.wap.mu

Đã chỉnh sửa. MrKen (02.05.2016 / 19:34)
15.08.2015 / 12:55
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

Hay! Tốt

15.08.2015 / 12:56
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

Get html là mã nào thế?

15.08.2015 / 12:58
thaian2009
Bài đăng: 709
Member

Get html dùng curl hoặc hàm url_get_contents($url

15.08.2015 / 13:17
hanhphucao
Bài đăng: 2470
Admin
Admin là người tận tâm và luôn hành xử đúng mực.

Bí mỗi đoạn login :4:

15.08.2015 / 13:34
facebook
Bài đăng: 296
Member
Điếc không sợ súng

Php chua sài dc huhu co twig ko

15.08.2015 / 13:39
hanhphucao
Bài đăng: 2470
Admin
Admin là người tận tâm và luôn hành xử đúng mực.

Host chứ ego có cũng éo dùng được :3

15.08.2015 / 13:40
hanhphucao
Bài đăng: 2470
Admin
Admin là người tận tâm và luôn hành xử đúng mực.

Lỗi đoạn này: $html = split('<div class="center">',$html[1]); :4:

15.08.2015 / 13:44
thaian2009
Bài đăng: 709
Member

Mật khẩu trong đó An ví dụ thôi ko phải mk thật sao login dc, An test trc rồi rất ok

15.08.2015 / 13:45
thaian2009
Bài đăng: 709
Member
facebook đã viết

Php chua sài dc huhu co twig ko

Cái này up lên host rồi dùng iframe hoặc js kéo về :3