-1
I got a ready-made website that has over 3,000 pages and many of them have a quote form. The problem is that the form action sends the data to an URL without extension.
<form action="http://www.benicorte.com.br/fabricacao-de-moveis/enviar-cotacao" id="formulario-cotacao" method="post">
<input type="hidden" name="acao" value="cotacao">
<input type="hidden" name="produto_nome" value="">
<input class="url-atual" type="hidden" name="produto_url" value="">
<input class="url-atual" type="hidden" name="produto_ref" value="">
<input type="hidden" name="imagem" value=""/>
<input type="hidden" name="site" value="index.html"/>
<input type="hidden" name="email" value="[email protected]"/>
<input type="hidden" name="projeto" value="2455"/>
<div class="item-form" id="campos-formulario">
<p><label>Nome: <input type="text" name="nome"></label></p>
<p class="error-message" id="erro_nome"></p>
<p><label>Email: <input type="email" name="email_contato"></label></p>
<p class="error-message" id="erro_email_contato"></p>
<p><label>Telefone: <input type="text" name="telefone" class="telefone"></label></p>
<p class="error-message" id="erro_telefone"></p>
<p class="error-message" id="erro_palavra"></p>
</div>
<div class="item-form" id="mensagem-formulario">
<p><label>Mensagem: <textarea name="mensagem"></textarea></label></p>
<p class="error-message" id="erro_mensagem"></p>
</div>
<div class="clear"></div>
<div class="cta-formulario">
<div class="seguranca-cta-formulario">
<div class="item-cta">
<div class="g-recaptcha"
data-sitekey="0000000000000000"></div>
</div>
<div class="item-cta">
<button type="button" id="btn-enviar-cotacao" class="btn-verde">Enviar cotação</button>
<img src="../imagens/ajax-loader.html" class="image-loading" id="loader-ajax" alt="Aguarde..." title="Aguarde..." style="display:none">
</div>
</div>
</div>
</form>
Could someone explain to me how to send these form fields by email through PHP?
I don’t know what that’s about ...The problem is that the form action sends the data to an URL without extension... worries you, maybe that How can I simplify Urls for a website? or this What is REST and Restful? help you. And as for the email see
mail()
and also see Phpmailer– Augusto Vasques
Complementing the @Augustovasques reply: the form you see can send the completed data to a back-end (in this case what is behind the route
http://www.benicorte.com.br/fabricacao-de-moveis/enviar-cotacao
) and there you can receive the data and use mail to send them by e-mail.– Daniel Freitas