Echo图片来自PHP [关闭]

I know it may sound stupid, but im trying to echo an image that i get his name from the url, i dont get anything only the alt text of the image.

This is my code

<?php
$url =  $_GET["userpic"];
$DisplayImg = "./Imagenes/".$url.".jpg";
?>
<html>
<body>

<img src="<?php echo $DisplayImg; ?>" alt="Error" width="100%" height="100%" border="0" /> 
</body>
</html>

Dante,

Change the extension to .php instead of .html

If you want to run a php code into a .html refer to How do I add PHP code/file to HTML(.html) files?

Try this:

<html>
<body>
<img src="../Imagenes/<?php echo $_GET["userpic"]; ?>.jpg" alt="Error" width="100%" height="100%" border="0" /> 
</body>
</html>

If that still dont work then your path is wrong you can see it by adding

<?php echo "<a href='../Imagenes/".$_GET["userpic"].".jpg'>this should link to your image</a>"; ?>