Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Jak udawac przegladarke
shl
post 29.01.2005, 19:05:25
Post #1





Grupa: Zarejestrowani
Postów: 24
Pomógł: 0
Dołączył: 8.12.2004
Skąd: Wrocław

Ostrzeżenie: (0%)
-----


Co nalezy i jak zglosic by skrypt ktory wchodzi na jaks strone udawal przegladarke ? Naglowki ale jakie i z czym sie to je ? Gdzie szukac czegos na ten temat ? Moze jakies wzorce do podpatrzenia ?
Go to the top of the page
+Quote Post
ennics
post 29.01.2005, 19:12:18
Post #2





Grupa: Zarejestrowani
Postów: 312
Pomógł: 0
Dołączył: 29.12.2004

Ostrzeżenie: (0%)
-----


http://forum.php.pl/index.php?act=Search&C...s&highlite=curl


--------------------
Go to the top of the page
+Quote Post
dr_bonzo
post 30.01.2005, 00:52:40
Post #3





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

Ostrzeżenie: (0%)
-----


http://snoopy.sourceforge.net/


--------------------
Nie lubię jednorożców.
Go to the top of the page
+Quote Post
hwao
post 30.01.2005, 10:57:28
Post #4


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




fsockopen" title="Zobacz w manualu PHP" target="_manual()
Szczegulnie kometarze

  1. <?php
  2. $repeat = 100; // How many times repeat the test
  3.  
  4. $timeout = 100; // Max time for stablish the conection
  5. $size = 16; // Bytes will be read (and display). 0 for read all
  6.  
  7. $server = '64.246.30.37'; // IP address
  8. $host = 'www.foo.com'; // Domain name
  9. $target = '/poll/answer.asp'; // Specific program
  10. $referer = 'http://www.test.com/'; // Referer
  11. $port = 80;
  12.  
  13. // Setup an array of fields to get with then create the get string
  14. $gets = array ( 'get_field_1' => 'somevalue',
  15.  'get_field_2' => 'somevalue' );
  16.  
  17. // Setup an array of fields to post with then create the post string
  18. $posts = array ( 'post_field_1' => 'somevalue',
  19.  'post_field_2' => 'somevalue' );
  20.  
  21. // That's all. Now the program proccess $repeat times
  22.  
  23. $method = &#092;"GET\";
  24. if ( is_array( $gets ) ) {
  25.  $getValues = '?';
  26.  foreach( $gets AS $name => $value ){
  27.  $getValues .= urlencode( $name ) . &#092;"=\" . urlencode( $value ) . '&';
  28.  }
  29.  $getValues = substr( $getValues, 0, -);
  30. } else {
  31.  $getValues = '';
  32. }
  33.  
  34. if ( is_array( $posts ) ) {
  35.  foreach( $posts AS $name => $value ){
  36.  $postValues .= urlencode( $name ) . &#092;"=\" . urlencode( $value ) . '&';
  37.  }
  38.  $postValues = substr( $postValues, 0, -);
  39.  $method = &#092;"POST\";
  40. } else {
  41.  $postValues = '';
  42. }
  43.  
  44. $request = &#092;"$method $target$getValues HTTP/1.1rn\";
  45. $request .= &#092;"Host: $hostrn\";
  46. $request .= 'User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) ';
  47. $request .= &#092;"Gecko/20021204rn\";
  48. $request .= 'Accept: text/xml,application/xml,application/xhtml+xml,';
  49. $request .= 'text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,';
  50. $request .= &#092;"image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1rn\";
  51. $request .= &#092;"Accept-Language: en-us, en;q=0.50rn\";
  52. $request .= &#092;"Accept-Encoding: gzip, deflate, compress;q=0.9rn\";
  53. $request .= &#092;"Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66rn\";
  54. $request .= &#092;"Keep-Alive: 300rn\";
  55. $request .= &#092;"Connection: keep-alivern\";
  56. $request .= &#092;"Referer: $refererrn\";
  57. $request .= &#092;"Cache-Control: max-age=0rn\";
  58.  
  59. if ( $method == &#092;"POST\" ) {
  60.  $lenght = strlen( $postValues );
  61.  $request .= &#092;"Content-Type: application/x-www-form-urlencodedrn\";
  62.  $request .= &#092;"Content-Length: $lenghtrn\";
  63.  $request .= &#092;"rn\";
  64.  $request .= $postValues;
  65. }
  66.  
  67. for ( $i = 0; $i < $repeat; $i++ ) {
  68.  $socket = fsockopen( $server, $port, $errno, $errstr, $timeout );
  69.  fputs( $socket, $request );
  70.  if ( $size > 0 ) {
  71.  $ret = fgets( $socket, $size );
  72.  } else {
  73.  $ret = '';
  74.  while ( !feof( $socket ) ) {
  75.  $ret .= fgets( $socket, 4096 );
  76.  }
  77.  }
  78.  fclose( $socket );
  79.  echo &#092;"<hr> $i -- $content $ret\";
  80. }
  81. ?>
Go to the top of the page
+Quote Post
Spirit86
post 1.02.2005, 17:30:14
Post #5





Grupa: Zarejestrowani
Postów: 607
Pomógł: 23
Dołączył: 8.09.2004
Skąd: Wrocław

Ostrzeżenie: (0%)
-----


np. tak:
  1. <?php
  2. ini_set('user_agent','MSIE 4.0b2;'); 
  3. ?>


Musisz mieć uprawnienia do używania tej funkcji. (jest wyłaczona chyba przy SAFE_MODE=ON)

Ten post edytował Spirit86 1.02.2005, 17:30:58


--------------------
Audio: Metallica, Soil, RHCP, OffSpring, Green Day, "Retro", Gorillaz, Disturbed, Coma
DB: MySQL 4.1 | php: 4.4.3 Pomogłem Ci? Wciśnij przycisk POMÓGŁ.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 18.07.2025 - 23:16