Search code examples
phptwitter-bootstrapmodal-dialogsendfriend

send a friend in modal bootstrap


Well, before asking here I have tried to find an answer for the issue I work with. Maybe someone who knows will help to find solution. I'm using bootstrap framework and here I have a "send friend" button which shows a modal fill-in form.

here's link: http://codepen.io/anon/pen/bNvOPB?editors=100

If fill out the form and press submit, it should send the data to the recipient. `

$name = $_POST["name"];
$email = $_POST["email"];
$sub ="$name, look this ";
$mes = "<b><u>Hi, $name.</u></b><p>text</p>";

$verify = mail ($email,$sub,$mes,"Content-type:text/html; charset = utf-8");

?>`

Individually all works fine, but if join together, the data don't come? Please, help with sending data and back to modal as a confirmation.

I tried to solve this by myself for several days, but now I give up.


Solution

  • change

          <button type="submit" name="submit" class="btn btn-sm" data-dismiss="modal" aria-hidden="true">Send</button> 
    

    to

          <button type="submit" name="submit" class="btn btn-sm" >Send</button> 
    

    plus if you want to get a confirmation . try submiting the form via ajax. and get success as json response basis on which u can show the message and close the modal.