• Resolved eendkonijn

    (@eendkonijn)


    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • hi,
    It just happened to your site or the problem get too long before?

    Thread Starter eendkonijn

    (@eendkonijn)

    I put the contact form on the site about three-four weeks ago, it never worked

    so there you use custom page right? for CF7 we need to use Shortcode and replace any where on your site, so on the page working right?

    Thread Starter eendkonijn

    (@eendkonijn)

    I am not sure what you mean, but yes I think CF7 makes use of shortcode. But that does not work for the page I mentioned.

    that is the custom page design right? I meant the page you use the contact form. So just only that page not working or for all page on the site, Just want to know it again, so if the short code not working there you can added the DO SHORTCODE function from wordpress to your template.

    Thread Starter eendkonijn

    (@eendkonijn)

    Ah yes I found the DO SHORTCODE function and now it works! Thank you for your input.

    laurarodd

    (@laurarodd)

    Your contact form can be easily deployed by placing its shortcode wherever you’d like the form to appear whether it’s in page, post, or widget area. Then messages submitted via the forms are sent to the email address you’ll have provided in the plugin settings. You can see here a step by step guide on how to add a contact form plugin into your WordPress site and how to maximize your use of them. Hope it helps! ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom Contact form not working’ is closed to new replies.