I am try to get jpg file names from a text file and print the image and file name on a html page.
but i can not get the variable to go to read.php
Errors on read.php
Warning: imagecreatefromjpeg(tmb/thb'<?=$test/;?>') [function.imagecreatefromjpeg]: failed to open stream: No error in C:\xampp\htdocs\read.php on line 30
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\read.php:30) in C:\xampp\htdocs\read.php on line 32
Warning: imagejpeg() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\read.php on line 34
main page
<?php
$myFile = "anastasio.txt";
$fh = fopen($myFile, 'a+');
$theData = fread($fh, filesize($myFile));
fclose($fh);
$wordChunks = explode("&", $theData);
for($i = 0; $i < count($wordChunks); $i++){
$order_array[$i] = $wordChunks[$i];
$test = "$order_array[$i]";
?>
<a href="read.php?variable=<?=$test/;?> " target="_blank">
// this so i can wont is happening on read.php
<img src="read.php?variable=chelsfordws014.jpg" border="0"></a>
// this is to check read.php is working
<?php echo "$test " ;
}
?>
Read.php
<?php
$testa = $_GET["variable"];
$imagesel="tmb/thb$testa";
$imagepath="$imagesel";
$image=imagecreatefromjpeg($imagepath);
header('Content-Type: image/jpeg');
imagejpeg($image);
?>