Contactform validation + more
# January 6, 2010 at 2:05 pm
I’m making a contact form, and i want in to be validated on submission page. I mean, that there’s some required fields, and if the person who wants to contact me, doesn’t write anything in the fields, a message like this shows up over the contact field: "You need to fill this one out."
If you can put it into my code it would be fine :)
I’ve also tried to make my own "send.php", but i dont think it work. I would like, if someone would check it, and eventually tell me what i need.
Mail.php:Code:< ?php $navn = $_POST ['navn']; // navnet på afsenderen $from = $_POST ['mail']; // afsenderens mail $subject = $_POST ['emne']; // emne $category = $_POST ['kategori']; //Find ud af mere $message = $_POST ['besked']; // Beskeden $body = ""; $body .= "Navn:"; $body .= $navn; $Body .= "n"; $body .= "E-mail:"; $body .= $from; $Body .= "n"; $body .= "Besked:"; $body .= $message; // Send mailen mail ($category, $subject, $body); ?>
Hopefull somebody has a solution – and have a nice day! :)
Dev# January 6, 2010 at 6:15 pm
There are a LOT of PHP based contact form tutorials online… I know that Chris has at least one in the Screencasts section of the site. Rather than simply having someone write the code for you, I’d suggest working through a tutorial so you actually understand what you are doing. If you have issues, you can then post here.
You must be logged in to reply to this topic.