Sylvia Gerald
Sylvia Gerald

Reputation: 29

Image Search In Folder PHP

I am getting an image from user and storing it in a folder. Now using the image name i have to search the image in that same folder.The image is stored correctly in the folder.For search i am using some thing like this :

     echo '<img src="upload/'.$thumb.'" " />';        

the variable $thumb is having the image name.It is getting the image name like that :

    $thumb=$_POST['thumbnailPic'];

Upvotes: 0

Views: 229

Answers (1)

Awlad Liton
Awlad Liton

Reputation: 9351

if(isset($_REQUEST['thumbnailPic'])) {
   $thumb=$_REQUEST['thumbnailPic'];
  echo '<img src="upload/'.$thumb.'" />';
 }
else {
  die("no thumbnailPic is found!");

}

I think you have extra quotes in the image src :

 echo '<img src="upload/'.$thumb.'" " />';   
                                    ^---- this is extra quotes

Should be:

echo '<img src="upload/'.$thumb.'" />';

That quotes makes your img tag inavlid. Also check images permission

Upvotes: 1

Related Questions