Skip to content
Advertisement

Can’t get image URL with $_GET and display image

I’m trying to use a parameter in the URL to get a Image Path, then display the image on the Website. I have tried this, but it doesn’t work.

URL is like: https://DOMAIN/file.php?logo=https://DOMAIN/IMG/image.png

JavaScript

I have also tried the (No quotation marks but that didn’t work either.

Thanks!

Advertisement

Answer

Since $logo is a PHP variable, so if you don’t call it in side <?php ?> then it will literally print out <img src="$logo"> in the HTML element.

Code:

JavaScript

OR:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement