Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Contact form

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #165574
    whipflash
    Participant

    Hey! I want this code to kick in after the person clicked “Skicka Meddelande”

    This code :

    <?php

    $to = “[email protected]”;
    $from = $_POST[“email”];
    $subject = $_POST[“subject”];
    $name = $_POST[“name”];
    $message = $_POST[“message”];

    if (mail ($to, $subject, $message ,”From: $name <$from>”))

    echo nl2br(“<h2>Ditt meddelande har skickats!</h2>
    <b>mottagare:</b> $to
    <b>ämne:</b> $subject
    <b>meddelande:</b>
    $message
    “);

    else
    echo “Det gick inte att skicka ditt meddelande”;

    ?>

    I dont want the code to break the pop up and and switch to another url.

    Here is the code I have atm : http://jsfiddle.net/xkdNa/179/

    Any questions just ask !

    Regards

    #165588
    whipflash
    Participant

    Isnt there any easier way.. like , if click this button hide this div and show another?

    Check out my website : http://spidey.se/ It’s that “Registrera” button I want to fix.. :/

    #165658
    whipflash
    Participant

    Sorry I didnt explain it so good, it’s not that kind of register thing you mean (through a database), its a contact form. When the person has written his information in the inputs , and then clicked “send message” All the stuff he wrote will come in a mail to my email.

    As you can see in my code (link below) when you hit “send message” it takes me to another url and I dont want that. I want it like this, when you click “send message” it comes a litle message just under the button, “Your mail has been sended” or the inputs disappears and a bigger “Sended” text appears .

    http://jsfiddle.net/xkdNa/182/

    #165680
    __
    Participant

    when you hit “send message” it takes me to another url and I dont want that.

    You explained it just fine, and @shaneisme answered your question very clearly.

    that’s part of what AJAX will help you with.

    If you don’t know what AJAX is, here’s a good place to start. Javascript libraries, like jQuery, also have functions that help simplify using ajax. If you need further help, please explain what it is you do not understand.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.