-4

I get name of the photo form database and i need to show fake name when i inspect it on website. Is it possibile in PHP or JavaScript to hide or hash image source?

<img src="img//<?php echo $_SESSION['name'] ?>.jpg" />
MIchalloo
  • 3
  • 1

1 Answers1

0

Unless the image is loading from a temporary source, there is no way to "hide" the image URL, otherwise the browser would have no way of knowing how to load the image.

Your options are:

  1. Create a dynamic image that requires some kind of verification to see it (eg, session based).

  2. Load the image content in PHP, then echo the contents as a base64 string inline into the <img> tag. Eg: Embedding Base64 Images

Community
  • 1
  • 1
Ian
  • 24,116
  • 22
  • 58
  • 96