I have the following code:
<section class="margem-base-80 coluna sombra-suave" id="recipiente-topo">
<h1 class="margem-topo-50 recipiente letra-branca">Gerar QRcode
gratuitamente</h1>
<main class="em-linha" id="main-index">
<article class="recipiente" id="campo-qr">
<form class="coluna" method="post">
<label for="gerar-qr">Endereço web (URL)</label>
<input type="text" name="code" id="code-input"
placeholder="http://exemplo.com" required />
<input type="hidden" name="gerar" value="s">
<div>
<button class="btn-azul margem-topo-50">Gerar QR code</button>
</div>
</form>
</article>
<?php
if(isset($_POST['gerar'])) {
require_once "interno/phpqrcode/qrlib.php";
$valor = $_POST['code'];
$code = $valor;
QRcode::png($code, "Imagem_QRCODE_M.png", QR_ECLEVEL_M, 8);
$qr= '<img id="tamanho-code" src="Imagem_QRCODE_M.png"/>';
?>
<article class="recipiente" id="qr-campo">
<?=$qr?>
</article>
<?php
} else { ?>
<article class="recipiente" id="qr-campo">
</article>
<?php
}
?>
</main>
</section>
This sample image is not in a database and is also not in a folder between the site files, it is only appearing on the site through my html code because it is a qr code image that the site generates by receiving the data via post. For some user to save this image on his computer he has to right click and then go to save images. How can I do to add my button to download this image as soon as the client clicks on it?