En cours

Fix PHP Mail Form / Wordpress Issue

Im having some issues with a PHP Mail form i have setup on a wordpress site of mine.

Once a user fills in the form located at:

[url removed, login to view]

They click submit.

The page reloads, but without any page content, i would like the contact form to reload.

Try it, too see the result!

Here is my code for the contact page (using a custom page template)


<?php /* Template Name: LOTR_Meet */ ?>

<?php get_header(); ?>

<div id="left">

<div class="post">

<div class="post_title"><h1 class="font"><?php the_title(); ?></h1></div>

<div class="post_content">

<form id="contactform" method="post" action="">

<fieldset id="contactleft">

<label for="name" class="font">name:</label>

<input id="name" name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]]"/>

<br />

<label for="subject" class="font">subject:</label>

<input id="subject" name="subject" type="text" class="validate[required,length[0,100]]"/>

<br />

<label for="phone" class="font">phone number:</label>

<input id="phone" name="phone" type="text" class="validate[required,custom[onlyNumber],length[8,10]]" />

<br />

<label for="email" class="font">email:</label>

<input id="email" name="email" type="text" class="validate[required,custom[email],length[0,50]]" />


<fieldset id="contactright">

<label for="comments" class="font">comments:</label>

<textarea id="comments" name="comments" rows="5" cols="5" class="validate[required]"></textarea>

<input type="submit" value="Send It!" class="submit_btn font" />



<?php the_post(); ?>

<?php the_content(); ?>




<?php get_sidebar(); ?>

<?php get_footer(); ?>


Here is my code at the top of the header file



if(isset($_POST['name'])) {

$email_to = "me at [url removed, login to view]";

$email_subject = "LOTR Contact Form";

// validation expected data exists

if(!isset($_POST['name']) ||

!isset($_POST['subject']) ||

!isset($_POST['phone']) ||

!isset($_POST['email']) ||

!isset($_POST['comments']) ) {



$name = $_POST['name']; // required

$organisation = $_POST['subject']; // required

$phone = $_POST['phone']; // required

$email = $_POST['email']; // not required

$comments = $_POST['comments']; // required

$email_message = "LOTR Contact Form.\n\n";

function clean_string($string) {

$bad = array("content-type","bcc:","to:","cc:","href");

return str_replace($bad,"",$string);


$email_message .= "Name: ".clean_string($name)."\n";

$email_message .= "subject: ".clean_string($organisation)."\n";

$email_message .= "Phone: ".clean_string($phone)."\n";

$email_message .= "Email: ".clean_string($email)."\n";

$email_message .= "Comments: ".clean_string($comments)."\n";

// create email headers

$headers = 'From:'.$email."\r\n".

'Reply-To: '.$email."\r\n" .

'X-Mailer: PHP/' . phpversion();

$ret = @mail($email_to, $email_subject, $email_message, $headers);

setcookie("seeMeOnce", $ret);



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url removed, login to view]">



To fix this you are going to need to know wordpress well, and php mail forms.

Please do not bid on this project unless you know how to fix it!

I need this completed ASAP

Am willing to pay $30

Compétences : Formulaires électroniques, HTML, Javascript, PHP, WordPress

Voir plus : you mail, w3 validation, try wordpress, subject php, site php template, php string html, php contact forms, name validation javascript, html javascript code template, html doctype, create contact form php, array template, validate custom onlynumber, fix wordpress mail, wordpress mail form, php create function, doctype html, wordpress x, wordpress site issue, wordpress font, php mailer, my mail, mailer html, mail fix, issue fix wordpress

Concernant l'employeur :
( 64 commentaires ) Melbourne, Australia

N° du projet : #1080583

Décerné à :


I have fix same problem with your current problem..i can fix only in 3 minutes.

30 $ AUD en 1 jour
(4 Commentaires)

2 freelance ont fait une offre moyenne de 30 $ pour ce travail


see your pmb please

30 $ AUD en 0 jours
(152 Commentaires)

ready to work for you.

30 $ AUD en 0 jours
(29 Commentaires)