<?php
if(isset($_GET['img']) && is_numeric($_GET['img'])){
$img = $_GET['img'];
$imgarray = array (
'1' => 'http://www.path/to/image1.png',
'2' => 'http://www.path/to/image2.png',
'3' => 'http://www.path/to/image3.png'
);
$src = $imgarray[$img];
header('Content-type: image/png');
echo file_get_contents($src);
}
else
{
header('Content-type: image/png');
echo 'Image could not be loaded';
}
?>
Hello again stackoverflow! Im having multiple problems. 1: When the $_GET['img'] is set and its numeric, the image will be displayed right, but i want to add text in the upper-right corner of the image... How can i do that? I've looked through multiple GD tutorials and examples but i can't find my answer. 2: When $_GET['img'] isn't set i want to display the text: Image could not be loaded. How cna i do that? Because this doesn't seem to work...
Selamlar