- This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
hey there peeps.
Im trying to implement a contact form that uses php and then redirects to an error or success page.
What im getting stuck with is getting it to work inside wordpress.
Im trying to use the contact form chris setup a while back, well using the php code for it anyways.
Can anyone shed some light for me please.
Thanks
Here is the code im using:
The page template:
The contact form php code:
// 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 ““;
}
else{
print ““;
}
?>
And the redirect page:
I don’t see anything wrong with a quick overview, althouguh using a meta redirect sounds weird….
Looking at what your goal is, you may wanna give "WP Contact Form" a shot. It certainly did the job for me.
In the adminpanel you can set up a thank you, and fail message.
Also, its’ very secure (does all kinds of trimms and stript for possible injections). And it comes with a language file that one can use. Light weight, secure and customizable.
I say try it, it’s free
Check here
the problem may be the location of the action file contactengine.php
Try using a full URL to define its location