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
  • #165574

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

    This code :


    $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

    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 :

    Any questions just ask !



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

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


    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 .


    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.