note 75404 added to ref.curl

From: Date: Mon, 28 May 2007 04:38:33 +0000
Subject: note 75404 added to ref.curl
Groups: php.notes 
Request: Send a blank email to php-notes+get-126976@lists.php.net to get a copy of this message
hi everyone i have did some codes to detect the code from a third party website ?> $filename = "http://www.baddot.com" ; $dataFile = fopen( $filename, "r" ) ; if ( $dataFile ) { while (!feof($dataFile)) { $buffer = fgets($dataFile, 4096); //$myfile = html_entity_decode($buffer); full link without picture $myfile = htmlentities($buffer); if($myfile == "%.jpg"){ echo $myfile . "<br>"; echo "I got a picture named"; } } fclose($dataFile); } else { die( "fopen failed for $filename" ) ; } ?> but i have some problems which the script does not work even if the curl also wont work too can anyone help ? <?function html_to_array( $url, $element = null ){ if( !( $data = file_get_contents( $url ) ) ) return false; preg_match_all( '~<img.*?>(</img>)?~si', $data, $page['img'] ); preg_match_all( '~<div.*?>.*?[^<]</div>~', $data, $page['div'] ); preg_match_all( '~<style.*?>.*?[^<]</style>~', $data, $page['Inline_Css'] ); preg_match_all( '~<link.*?>~', $data, $page['Linked_Css'] ); preg_match_all( '~<meta.*?[^>]>~', $data, $page['Meta'] ); preg_match_all( '~<a.*?[^>].*[^<]</a>~', $data, $page['Link'] ); return !is_null( $element ) ? $page[ $element ] : $page ;}function display_links( $links, $htmlentities = true ){ foreach( $links as $number => $link ) { printf("Link number %d : [ %s ]<br />\n", $number + 1, $htmlentities ? htmlentities( $link ) : $link ); } } foreach( html_to_array( 'http://forums.digitalpoint.com' ) as $element => $html ){ printf( "I see %d %s tags<br />\n", count( $html[0] ), str_replace('_', ' ', $element ) );} foreach( html_to_array( 'http://forums.digitalpoint.com', 'Link' ) as $links ){ printf("I found %d links, here they are :<br />\n%s", count( $links ), display_links( $links ) );} ?> ---- Server IP: 64.71.164.2 Probable Submitter: 202.42.133.26 ---- Manual Page -- http://www.php.net/manual/en/ref.curl.php Edit -- https://master.php.net/note/edit/75404 Del: integrated -- https://master.php.net/note/delete/75404/integrated Del: useless -- https://master.php.net/note/delete/75404/useless Del: bad code -- https://master.php.net/note/delete/75404/bad+code Del: spam -- https://master.php.net/note/delete/75404/spam Del: non-english -- https://master.php.net/note/delete/75404/non-english Del: in docs -- https://master.php.net/note/delete/75404/in+docs Del: other reasons-- https://master.php.net/note/delete/75404 Reject -- https://master.php.net/note/reject/75404 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#126976) next »