I am making a form which once it is sent, it should send an SMS thanking the contact for the number in which it was informed on the form.
I have the following form:
<form action="processa.php" method="post">
<div>
<label for="nome">Nome:</label>
<input type="text" id="nome" name="nome" />
</div>
<div>
<label for="email">E-mail:</label>
<input type="email" id="email" name="email" />
</div>
<div>
<label for="telefone">Telefone:</label>
<input type="tel" id="telefone" name="telefone" />
</div>
<div>
<label for="msg">Mensagem:</label>
<textarea id="msg" name="mensagem"></textarea>
</div>
<div class="button">
<button type="submit">Enviar sua mensagem</button>
</div>
</form>
File - processa.php
<?php
$email = addslashes($_POST['email']);
$nome = addslashes($_POST['nome']);
$telefone = addslashes($_POST['telefone']);
$mensagem = addslashes($_POST['mensagem']);
$destinatario = "[email protected]";
$assunto = "Nova solicitação de contato";
$msg = "
Você recebeu a seguinte solicitação de contato:
-------------------------------------
Nome: $nome
Email: $email
Telefone: $telefone
Mensagem: $mensagem ";
$headers = "MIME-Version: 1.1\r\n";
$headers .= "Content-type: text/plain; charset=UTF-8\r\n";
$headers .= "From: NOME DO CONTATO <[email protected]>\r\n"; // remetente
$headers .= "Return-Path: [email protected]\r\n"; // return-path
$envio = mail($destinatario, $assunto, $msg, $headers);
if($envio){
header ("location: sucesso.html");
}else{
echo "A mensagem não pode ser enviada";
}
?>
The form when it is populated, it sends me an email with the data that was entered, and then redirects to sucesso.html
.
I would like that when the person submits the form, an SMS is sent to the person who filled out the form.
HTTP API - Example Usage
http://portal.gtisms.com:2000/gti/API/[email protected]&senha=teste&msg=Obrigado+Por+Entrar+Em+Contato&n=11984010101&id=0001
How to adapt the PHP script so that it makes a request for the HTTP API by sending an SMS to the number provided? The number ( $ phone ) should be assigned to the parameter
n=
. I would like an example = (