Fix PHP Mail Form / Wordpress Issue

Terminé Publié le May 31, 2011 Paiement à la livraison
Terminé Paiement à la livraison

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>

<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" />

</fieldset>

</form>

<?php the_post(); ?>

<?php the_content(); ?>

</div>

</div>

</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

------------------------------------

Here is my code at the top of the header file

-----------------------------------

<?php

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']) ) {

die();

}

$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]">

...etc....

---------------------------------

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

Formulaires électroniques HTML JavaScript PHP WordPress

Nº du projet : #1080583

À propos du projet

2 propositions Projet à distance Actif May 31, 2011

Décerné à:

rkurnia

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

%selectedBids___i_sum_sub_4% %project_currencyDetails_sign_sub_5% AUD en 1 jour
(4 Commentaires)
2.7

2 freelances font une offre moyenne de 30 $ pour ce travail

dracco

see your pmb please

$30 AUD en 0 jours
(152 Commentaires)
5.9
dungvit85

ready to work for you.

$30 AUD en 0 jours
(29 Commentaires)
4.5