Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Pobieranie naglowkow, okreslonych czesc strony...
AvantaR
post 14.06.2003, 14:08:14
Post #1





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 14.06.2003
Skąd: Łaziska Górne

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


Mam problem - jak zrobic skrypt ktory pobieralby mi naglowki z jakies strony i wyswietlal. Np. wycinalby czesc strony ktora jest reklama jakiegos produktu (w jakis sklepach np). Prosze o pomoc.


--------------------
I awake from my dream, I can't find my way without you ...
Go to the top of the page
+Quote Post
Jabol
post 14.06.2003, 16:02:25
Post #2





Grupa: Przyjaciele php.pl
Postów: 1 467
Pomógł: 13
Dołączył: 22.02.2003

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


[php:1:490df9a82b]<?php
$fp=fsockopen();
while(!feof($fp)){
$site.=fread($fp, 4096);
}
$parts=explode("nn", $site);
print $parts[0];
?>[/php:1:490df9a82b]Powinno dzialac.
Go to the top of the page
+Quote Post
AvantaR
post 14.06.2003, 16:08:34
Post #3





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 14.06.2003
Skąd: Łaziska Górne

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


Thx wyprobuje chociaz jeszcze nie bardzo wiem jak to dziala tongue.gif


--------------------
I awake from my dream, I can't find my way without you ...
Go to the top of the page
+Quote Post
Seth
post 14.06.2003, 17:26:36
Post #4





Grupa: Przyjaciele php.pl
Postów: 2 335
Pomógł: 6
Dołączył: 7.03.2002

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


Nie wiem czy przyklad Jabola naprowadzi Cie na cel, ale ten napewno:
[php:1:6da3741f73]
/*
by Seth
2002
*/

$host = '<nazwa hosta>'; // daj np: www.wp.pl
$adress = '<adres pliku>'; // np: / lub /index.html
$port = 80;

$errmsg = null;
$errno = null;

$chndr = fsockopen( $host, $port, &$errno, &$errmsg, 3 );

if ( $chndr == false )
{
print 'Blad nr: '.$errno.' wiadomosc bledu: '.$errmsg.'<br />';
}
else
{
fputs( $chndr, 'GET '.$adress." HTTP/1.0rn" );
fputs( $chndr, "Host: $hostrn" );
fputs( $chndr, "Referer: http://$host/rn" );
fputs( $chndr, "Content-type: application/x-www-form-urlencodedrn" );
fputs( $chndr, "Connection: closernrn" );

$end_headers = false;
$headers = '';

while ( !feof( $chndr ) )
{
$line = fgets( $chndr, 1024 );

if ( $end_headers === false )
{
$headers .= $line;
}

if($end_headers === false && ($line == "rn" || $line == "n"))
{
$end_headers = true;
}
}
}

print $headers;
[/php:1:6da3741f73]
Go to the top of the page
+Quote Post
Jabol
post 14.06.2003, 17:43:21
Post #5





Grupa: Przyjaciele php.pl
Postów: 1 467
Pomógł: 13
Dołączył: 22.02.2003

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


a no tak. Wogole zapomnialem o wyslaniu naglowkow...
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: 13.06.2025 - 03:19