Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6918349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:50:50+00:00 2026-05-27T09:50:50+00:00

I’m working on a WordPress theme that has a Jquery animated contact form in

  • 0

I’m working on a WordPress theme that has a Jquery animated contact form in it. I’ve got the js working (a div that’s gets shown/hidden on click, with the form in it). Here’s a static HTML/PHP example (click the ‘contact’ button). What’s the problem you say? The problem is that the actual form does not get send. I’ve got the php file ‘contact engine.php’ that sends the form inside a folder called ‘php’ in my template directory. In the HTML i’ve got:

<form method="post" action="<?php bloginfo('template_directory'); ?>/php/contactengine.php">
            <label for="Name">Name:</label>
            <input type="text" name="Name" id="Name" />
            <label for="Email">Email:</label>
            <input type="text" name="Email" id="Email" />
            <label id="bericht" for="Message">Message:</label><br />
            <textarea name="Message" rows="10" cols="20" id="Message"></textarea>
            <input type="submit" name="submit" value="Submit" class="submit-button" />
</form>

After a bit of fiddling I’ve narrowed the problem down to the actual link to the php file. WordPress does not send the input to the php-file, and nothing gets done. After some Google sessions I found that most people use a plugin for this, which I’m not a fan of. Also it seems that WordPress does not let you write your own php snippets to implement in the theme. I’ve also found something that suggests I should put the php snippet in the functions.php file that comes with every template, but I wouldn’t know how to link to a specific php snippet inside functions.php. Anyone knows how to solve this? Thanks in advance!

P.S. The php script looks like this:

<?php

$EmailFrom = "contactformulier@stefanhagen.nl";
$EmailTo = "info@stefanhagen.nl";
$Subject = "Contactformulier StefanHagen.nl";
$Name = Trim(stripslashes($_POST['Name'])); 
$Tel = Trim(stripslashes($_POST['Tel'])); 
$Email = Trim(stripslashes($_POST['Email'])); 
$Message = Trim(stripslashes($_POST['Message'])); 

// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
// $Body .= "Tel: ";
// $Body .= $Tel;
// $Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";

// send email 
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page 
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=../index.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:50:51+00:00Added an answer on May 27, 2026 at 9:50 am

    I know when you submit a form within WordPress your code will not work since WordPress filters all the post variables. When you use your own script that shouldn’t happen. So how does your contactengine.php script looks like. Do you use an include to WordPress in it? If so you do handle WordPress script.

    What I see on your site is that
    < ?php bloginfo(‘template_directory’); ?>
    doesn’t show up. It is also better to use
    < ?php echo get_template_directory_uri(); ?>

    In case of the plugins people use, I do that too. Easy to change the form in the backend but that can be a negative point since the customer can change it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.