Custom Contact form not working
-
Hi WordPress forum,
I hope someone can assist me.
Recently I downloaded some code for a contact form off the internet and placed it on my website. When i fill it out and click ‘send’, the page just reloads and nothing happens.
If I do an ‘incomplete’ fill (e.g. leave the name empty) the same thing happens, and no echo message appears. When I first tried this form this did work, but then I changed something and now it doesn’t (I was never able to receive an email through this form).
I tried different email addresses.
The custom theme of this page is built rather awkwardly into WordPress, and plugins such as Contact Form 7 are not working. However, I do run CF7 on another page within this same domain and this form works fine.
It’s the form on this page:https://hetvertaalcollectief.nl/welkom/
Here’s the code:
<?php $action=$_REQUEST['action']; if ($action=="") /* display the contact form */ { ?> <form action="" method="POST" enctype="multipart/form-data"> <input type="hidden" name="action" value="submit"> Je naam:<br> <input name="name" type="text" value="" size="30"/><br> Je email:<br> <input name="email" type="text" value="" size="30"/><br> Je bericht:<br> <textarea name="message" rows="7" cols="30"></textarea><br> <input type="submit" value="Send email"/> </form> <?php } else /* send the submitted data */ { $name=$_REQUEST['gebruikersnaam']; $email=$_REQUEST['email']; $message=$_REQUEST['message']; if (($name=="")||($email=="")||($message=="")) { echo "Vul alle velden in aub."; } else { $from="From: [email protected]"; $reply= "Reply-To: $name<$email>"; $subject="Het contactformulier is ingevuld"; mail("[email protected]", $subject, $message, $from, $reply); echo "Email sent!"; } } ?>
Thanks in advance for help & tips.
- The topic ‘Custom Contact form not working’ is closed to new replies.