Herzlich willkommen im Archiv vom ABAKUS Online Marketing Forum
Du befindest Dich im Archiv vom ABAKUS Online Marketing Forum. Hier kannst Du Dich für das Forum mit den aktuellen Beiträgen registrieren.
Code: Alles auswählen
$buffer =
file_get_contents (
'http://webcache.googleusercontent.com/search?q=cache:www.kramoo.de' );
$sSTART = 'wie diese am';
$sEND = 'angezeigt wurde';
$iSTART = strpos( $buffer, $sSTART );
$iEND = strpos( $buffer, $sEND );
$sDATUM = substr( $buffer, $iSTART+strlen($sSTART) , $$iEND);
Wie ich eben hingeklickt habe, um zu schauen ob was neues geschrieben wurdenerd hat geschrieben:das wird so nicht funktionieren, lieber Andy![]()
Code: Alles auswählen
$sDATUM = substr( $buffer, $iSTART+strlen($sSTART) , $$iEND);
Code: Alles auswählen
$iSTART += strlen($sSTART);
$iEND = $iEND - $iSTART;
$sDATUM = substr( $buffer, $iSTART, $iEND);
ähm, dein fopen() hat dann aber das selbe Problemnerd hat geschrieben: mit einem einfachen file_get_contents() werden keine browser-ueblichen header gesetzt
Code: Alles auswählen
function httpheader( $url ,$headonly=0)
{
$tok = strtok($url,'/');
$host= strtok( '/');
$path='/'.strtok( '');
$domain['host'] = @gethostbyname( $host );
$domain['host'].=' @ '. @gethostbyaddr( $domain['host'] );
$fp = @fsockopen ($host, 80, $error_number, $error_string, 30);
if ($fp)
{
fputs ($fp, "GET $path HTTP/1.0\r\nHost: $host\r\n\r\n");
$buffer=''; $block=256; $httph=0;
while (!feof($fp) && ++$httph)
{
$line=fgets($fp,$block);
if ( !strlen( trim($line) ) ) $httph=-1;
elseif ( $httph==1 )
{
$domain['tp'] =strtok($line,' ');
$domain['stat']=strtok( '');
}
else
{
$tok =strtolower(strtok($line,':'));
$domain[$tok]= strtok( '');
} $domain[http].=$line;
}
while (!feof($fp) && !$headonly)
{
$line=fgets($fp,$block);
$domain[html].=$line;
}
fclose($fp);
drüben im "18 Monate und dan AdSensZusatzRente bzw Beschäftigungsterapie" Frednerd hat geschrieben:(solche fragen obwohl du laut signatur webentwicklung anbietest)
Code: Alles auswählen
function get_url( $url ) // Auslese des Inhaltes einer URL mit einer Browsersimulation
{
$header[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
$header[] = "Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3";
$header[] = "Accept-Encoding: gzip,deflate";
$header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
$header[] = "Keep-Alive: 115";
$header[] = "Connection: keep-alive";
$header[] = "Pragma: no-cache";
$header[] = "Cache-Control: no-cache";
$cookie = tempnam ("../tmp", "CURLCOOKIE");
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 GTB7.1" );
curl_setopt( $ch, CURLOPT_HTTPHEADER, $header );
curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
curl_setopt( $ch, CURLOPT_ENCODING, 'gzip,deflate' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 10 );
curl_setopt( $ch, CURLOPT_TIMEOUT, 10 );
curl_setopt( $ch, CURLOPT_MAXREDIRS, 5 );
//curl_setopt( $ch, CURLOPT_REFERER, 'http://www.google.com');
//curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # wird für https urls benötigt
//curl_setopt( $ch, CURLOPT_USERPWD, 'user:passw' );
$html = curl_exec($ch); // führt curl aus
curl_close($ch); // schließt curl wieder
return $html; // gibt den Inhalt der Seite zurück
} // schließt die Funktion get_url