Image Generator

-1

Someone knows how to create a PHP code to generate an image that is passed by the url if image.php?src=logo&width=600&height=600 is passed and the final result is an image with the specific dimensions and go to imgs/logo.png .

PS: The format must be .png .

    
asked by anonymous 07.07.2018 / 18:31

1 answer

1

You need to get the parameters by get and assign the HTML img tag.

For example. If your page is this "image.php? Src = logo & width = 600 & height = 600" the code will be:

<img src="imgs/<?php echo $_GET['src'] ?>.png" width="<?php echo $_GET['width'] ?>" height="<?php echo $_GET['height'] ?>">
    
08.07.2018 / 00:10