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:
<?php
$EmailFrom = \"site@trading-strategy.com\"; $EmailTo = \"jdtrader21@yahoo.com\"; $Subject = \"Some one has signed up for your newsletter\"; $Email = Trim(stripslashes($_POST['Email']));
// redirect to success page if ($success){ print \"<meta http-equiv=\\"refresh\\" content=\\"0;URL=http://trading-strategy.com/\">\"; } else{ print \"<meta http-equiv=\\"refresh\\" content=\\"0;URL=error.htm\\">\"; } ?>
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.
$EmailFrom = \"site@trading-strategy.com\"; $EmailTo = \"jdtrader21@yahoo.com\"; $Subject = \"Some one has signed up for your newsletter\"; $Email = Trim(stripslashes($_POST['Email']));
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
<?php bloginfo(’template_directory’); ?>
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.
Here is the contactengine.php code:
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.
*Edit* I re-read your post and initially misunderstood. Robski is right, you'll want to use header redirects.