I want to store images created by php in real time. Currently each image is destroyed after creation, but instead I want to store the images in an unique folder on my website.
I have seen many websites that use a dedicated dump folder, e.g. http://www.example.com/dump/4592898349.jpg
, and I was wondering if someone could explain to me how I could do that.
This is my html code with the form that starts the image generation:
<html>
<body>
<form action="result.php" method="get">
<input type="text" name="name" id="name">
<input type="button" name="submit" id="submit">
</form>
</body>
</html>
And here is my php code, which creates the image with the given text:
<?php
header('Content-type: image/jpeg');
$jpg_image = imagecreatefromjpeg('Desert.jpg');
$white = imagecolorallocate($jpg_image, 73, 41, 236);
$font_path = 'OpenSans-Italic.TTF';
$text = $_GET['name'] ;
imagettftext($jpg_image, 25, 0, 75, 50, $white, $font_path, $text);
imagejpeg($jpg_image);
imagedestroy($jpg_image);
?>
However, I still don't know where would be the best place to save the image.