I’ve added the ability to email articles. The plugin is a little screwy though. Not only is the message awkwardly worded (I’ve fixed it up somewhat), but after the message is mailed, it takes users to an unformatted page. The code can be found here, and the offending chunk of it is, I think, this:
Article: $post_title Has Been Sent To $friendemail "; ';if($mail->Send()) {
get_header();
echo "
get_sidebar();
get_footer();
exit();
} else {
get_header();
echo '
get_sidebar();
get_footer();
}
The div tags aren’t showing up but that makes it easier to find where I’m having the problem in the code.
I know it has to do with how it’s retrieving the header, sidebar, and footer. The deal is, I have no idea what I’m doing and usually am only able to figure this stuff out when I have something to go off of. The layout for the email form was screwy and I was able to fix it by making it look like my standard page layout.
Ideally, I’d like the thing to just redirect to the main page or back to the post after it sends the email. Surely one of you know how to do this or could at least point me in the right direction, right?
{ 1 comment }
Perhaps the PHP header function is what you are looking for? You can use the PHP statement
header("Location: http://www.registan.net");to redirect to the main page.