I have an HTML page that has the content shown below.
I want to display the image in the browser using a PHP script file titled "load_image.php"
that loads the image using the PHP script and passing the image to the html page for display in the browser.
What will be the best PHP sctipt to do that? The image, image.gif
, is located in the same directory as the html page and the PHP script.
I included a PHP working script that I am currently using, however it has some limitations that I want to avoid with a different script.
There is a reason why I use a PHP script and not a simple link in the HTML page to load the image.
Thanks, Menachem Blasberg
HTML Page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>
<body>
<img src="http://www.inoxel.com/load_image.php" >
</body>
</html>
The image is my_image.gif
Current "load_image.php"
PHP script:
<?php
$my_image = "http://www.example.com/my_image.gif"; // Set image Full Path
readfile($my_image);
?>