- 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.
I am using Chris’s simple form on a wordpress site for one of my clients. Normally in the contactengine.php file I just put a file like index.html for the redirect. For the wordpress site I cannot do that. I have tried putting in the directory (ie, /contact/) as well as the full url, but after a form is submitted wordpress pulls up a 404 Not Found page.
Here is the contactengine.php code:
// prepare email body text
$Body .= “Email: “;
$Body .= $Email;
$Body .= “n”;
// send email
$success = mail($EmailTo, $Subject, $Body, “From: <$EmailFrom>“);
// redirect to success page
if ($success){
print ““;
}
else{
print ““;
}
?>
Any help would be appreciated, not a PHP wizard. In case you need it the website is trading-strategy.com, and it is currently down right now because said client made a boo-boo.
try this..not a php expert either. might work
// prepare email body text
$Body .= “Email: “;
$Body .= $Email;
$Body .= “n”;
// send email
$success = mail($EmailTo, $Subject, $Body, “From: <$EmailFrom>“);
// redirect to success page
if ($success){ ?>
This is a little wordpress quirk. Basically, except for the styles, referencing static files in your html doesn’t work properly when they reside in the theme directory. So instead, what you have to do is use this template tag
to denote the root of the theme directory, and then write the rest of your url from there.
*Edit* I re-read your post and initially misunderstood. Robski is right, you’ll want to use header redirects.