I have 2 websites and would like to reuse pictures from site A within side B using PHP.
I have looked into @readfile()
and
header('Content-Type: image/png');
echo(file_get_contents('http://site_a.com/img.png'));
Because I like to show the picture inside my content, I get an obvious headers already sent error.
Is there a way around this or an other function to show a png
picture which is stored on my other site?
Ask asked to show the code:
<html>
<head>
<title>test</title>
</head>
<body>
<h1>Content</h1>
<?php
header('Content-Type: image/png');
@readfile('http://site_a.net/img/picture.png');
?>
</body>
</html>