0
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 example image is not in a database and is also not in a folder among the files of the site, it is only being displayed on the site through my html code for being a qr code image that the site generates receiving the data via post. For some user to save this image on their computer it has to right-click and then go on to save images. How can I add my button download this image as soon as the customer clicks on it?
Please rephrase your question more clearly I am not able to understand what you want, put the code you have, tell what he is doing and what you should do
– Costamilam
actually I put the code, but it’s not showing.. it’s just a src img and a button below.. I edited the question to be clearer now..
– Francis Vagner da Luz