php - Form validation output not working -
i have form , form working: receive details on e-mail. when click submit, redirects blank page text: "request submitted successfully. contact soon.".
what show green box saying form submitted successfully, on same page websites do, , not redirect...
i using bootstrap :)
mailer.php code:
<?php $tipoin = $_post['tipoin']; $tipologia_input = $_post['tipologia_input']; $sender_name = $_post['nome']; $sender_email = $_post['email']; $phone = $_post['telefone']; $slider_value = $_post['slider_value']; $mail_body = $_post['message']; $body = $sender_name." sent new message you<br><br> name: ".$sender_name."<br>email: ".$sender_email."<br>phone: ".$phone."<br>tipo: ".$tipoin."<br>tipologia: ".$tipologia_input."<br>slider value: ".$slider_value."<br>message: ".$mail_body; sendmail($sender_name , $sender_email, $body); function sendmail($sender, $sender_mail, $body) { $to = 'geral@porta10.com'; // set receiver email here $myemail = 'geral@porta10.comm'; // set sender email here $subject = "new easyloan client"; // set subject here $headers = "mime-version: 1.0\r\n"; $headers .= "content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "from: lead <geral@porta10.com>\r\n"; // set header here $message = $body; $sentmail = mail($to,$subject,$message,$headers); if($sentmail) { echo "request submitted successfully. contact soon."; } else { echo "mail not sent"; } } ?>
form code:
<div class="form-container"> <div class="form-mockup"> <h2>que imóvel procura ?</h2> <!-- <h4>easy apply loan us,once have complete form. </h4>--> <form action="mailer.php" method="post"> <div class="form-group"> <select class="form-control" id="tipo" name="tipoin"> <option value="tipo" disabled selected>tipo de imóvel</option> <option value="moradia">moradia</option> <option value="apartamento">apartamento</option> </select> </div> <div class="form-group"> <select class="form-control" id="tipologia" name="tipologia_input"> <option value="tipologia" disabled selected>tipologia</option> <option value="t1">t1</option> <option value="t2">t2</option> <option value="t3">t3</option> <option value="t4">t4</option> <option value="t5">t5</option> </select> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="nome completo" name="nome"> </div> <div class="form-group"> <input type="email" class="form-control" placeholder="e-mail" name="email"> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="telefone" name="telefone"> </div> <div class="form-group"> <textarea class="form-control" rows="3" id="comentario" placeholder="diga-nos como imagina sua casa..." name="message"></textarea> </div> <div class="form-group"> <div class="button-slider"> <div class="btn-group btn_group"> <div class="btn btn-default btn_amount">valor </div> <div class="btn btn-default btn_slider"> <input id="bootstrap-slider" type="text" data-slider-min="1" data-slider-max="50000" data-slider-step="1" data-slider-value="25000" name="slider_value" /> <div class="valuelabel"><span class="text_span">valor </span> <span id="slidervalue">25000</span>€</div> </div> </div> </div> </div> <button type="submit" class="btn btn-default quote_btn">enviar</button> </form> </div> </div>
you can various things, depends on framework or cms or logic of code. there many ways accomplish task (showing on (same/existing) page , not redirecting (blank/defaced)) still depends.
2 main ways can imagine are:
- using ajax , json messaging between server , client , prevent reloading
- using session-keys show messages on page user loads afterwards.
Comments
Post a Comment