0
I’m trying to save what is written in a form in a txt file while the site’s Mysql does not update. I’ve seen an answer here, but it doesn’t fully answer my question
What can I use to save the form information to a text file after clicking the button? remembering that I want to use the <button id="btn-enviar"...
and not a Ubmit.
<div class="row">
<form id="form-enviar" name="nome" class="col s12" method="post">
<input type="hidden" id="act" name="act" value="ENVIAR">
<input type="hidden" id="private" name="private" value="">
<div class="row">
<div class="input-field col s12">
<input name="nome" id="nome" type="text" maxlength="40">
<label for="nome" class="active">Nome completo</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input name="idade" id="idade" type="text" maxlength="40">
<label for="idade" class="active">idade</label>
</div>
</div>
</form>
<div class="row">
<div class="col s12 center-align">
<a href="javascript:void(0);" class="btn-large modal-action modal-close waves-effect waves-purple btn-flat">CANCELAR</a>
<button id="btn-enviar" type="submit" class="waves-effect waves-light btn-large purple darken-1">Enviar</button>
</div>
</div>
</div>
</div>
Good night, use PHP’s file_put_content function: https://www.php.net/manual/en/function.file-put-contents.php
– Julio Leles White