0
<?php
    $path=$row['path'];
?>
<img src="<?php$path?>" alt="thing" >       

please tell if there is any other way , this is not working

Sterling Archer
  • 22,070
  • 18
  • 81
  • 118
Exotic Me
  • 17
  • 1
  • 8
  • PHP is a server sided language. In order to *properly* interact with it, you'll have to use JavaScript to make an XHR call, retrieve this path, and pass it into the image's src attribute. Mingling PHP and HTML as you have done is not a good practice – Sterling Archer Mar 06 '20 at 18:16
  • but i don't know java script. can you share syntax. it'll really help – Exotic Me Mar 06 '20 at 18:18
  • Please see this question for more details https://stackoverflow.com/questions/15757750/how-can-i-call-php-functions-by-javascript you're going to have to do a fair bit of research because something like this uses 3 languages to do in a modern way – Sterling Archer Mar 06 '20 at 18:20
  • `` You need to `echo $path`, just `$path` will do nothing. `` – brombeer Mar 06 '20 at 18:24
  • no , not working – Exotic Me Mar 06 '20 at 18:31

1 Answers1

0

I think you're missing a space here :

<img src="<?php echo $row['path']; ?>" alt="thing" >       
Nirnae
  • 1,315
  • 11
  • 23