Đang Thực Hiện

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

Kỹ năng: Electronic Forms, HTML, Javascript, PHP, WordPress

Xem thêm: you mail, you fix it, w3 validation, try wordpress, subject php, site php template, php string to html, php contact forms, name validation in javascript, my fix it, html code for contact form to email, html 5 with javascript code template, html 5 doctype, how to fix my, how to fix com, how to create php form, how to create php contact form, how to create forms in php, how to create a contact form in php, how fix it, how do you fix it, how do i fix my, how create form in php, fix it at, doctype html public html 5

Về Bên Thuê:
( 64 nhận xét ) Melbourne, Australia

Mã Dự Án: #1080583

Đã trao cho:


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

$30 AUD trong 1 ngày
(4 Đánh Giá)

2 freelancer đang chào giá trung bình $30 cho công việc này


see your pmb please

$30 AUD trong 0 ngày
(152 Đánh Giá)

ready to work for you.

$30 AUD trong 0 ngày
(29 Đánh Giá)