- This topic is empty.
-
AuthorPosts
-
March 12, 2014 at 3:20 pm #165574
whipflash
ParticipantHey! 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
March 12, 2014 at 4:33 pm #165588whipflash
ParticipantIsnt 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.. :/
March 13, 2014 at 7:39 am #165658whipflash
ParticipantSorry 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 .
March 13, 2014 at 11:00 am #165680__
Participantwhen 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.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.