Link to home
Start Free TrialLog in
Avatar of shang3000
shang3000

asked on

how to render images to using file_get_contents

hi all,
i asked a question before about making get requests and post requests from a site
and that was the answer :

<?php
$r_default_context = stream_context_get_default
        (
        array
                (
                'http' => array
                        ( // All HTTP requests are passed through a proxy server.
                        'proxy' => 'tcp://192.168.0.222:80', // Make sure IP and port are correct!!!
                        'request_fulluri' => True,
                        ),
                )
        );
 
// Though we said system wide, some extensions need a little coaxing.
libxml_set_streams_context($r_default_context);
?>
<?php
echo file_get_contents(''http://hatem.softwarelab.net');
?>
the code is working perfeclty but have one issue
if there is images with relative pathes it does not appear at all
can any body help me to solve this issue
best regards
HG
ASKER CERTIFIED SOLUTION
Avatar of Mark Gilbert
Mark Gilbert
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shang3000
shang3000

ASKER

hi ingwa,
thanks for reply,
can you please give me an example how to use it in this situation and what to search for using strpos?
best regards
HG