You’ve already got a check for $_POST
== empty.
**if (!empty($_POST)){
$pfs = pfs_submit($_POST,$_FILES);
echo json_encode($pfs);
//echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">".print_r($pfs, true)."\n";
wp_redirect("http://domda.se/tack/");
exit;
} else {
/* TODO: translate following */
_e('Den här sidan hade du inte behövt se, något är fel.','pfs_domain');
echo "<a href="".get_bloginfo("url')."'>" . __('Go home?','pfs_domain') . "</a>";
}**
Add an error handler there. You will need to pass a parameter through wp_redirect
…
wp_redirect("http://domda.se/tack/?myerror=error-code");
And process it on the receiving page…
if (isset($_GET['myerror'])) {
// do stuff
}
Related Posts:
- Let readers suggest edits from the frontend
- Contributive page where people logged in can write
- Trying to fix form resubmition with PRG (Getting error: Cannot modify header information – headers already sent by)
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- Plugin for visitors to edit content without logging in? [closed]
- Capturing POST data
- How to eliminate weird 404 errors in wp-admin?
- How Do I Use The WordPress Plugin Posts 2 Posts by Scribu?
- Simple form that saves to database
- How to get Login Error messages on a custom template
- How to Add jQuery Infinite Scroll to My Custom Archive Page
- publish_post hook isn’t working for scheduled posts
- Plugin.php: PHP Notice: Undefined offset: 0 in
- Publish Post After Click On A Link
- Enable comments for post with comments meta box removed
- How to disable autocomplete for inputs in contact form 7? [closed]
- Is there an action that is called when a post is restored from the trash?
- plugin for wp_list_categories with posts
- Action on post publish
- Replace existing pages with new pages, keep menu links
- Adding “ ” before the last word in multiple defined areas with a plugin
- How to change ID of an attachment in wp_posts and its related tables correctly?
- New post notification plugin [closed]
- Adding Plugin-specific Fields with wp_insert_post()?
- Hook into and send mail using WP Mail SMTP type plugin from HTML static front page?
- Call to undefined function get_userdata in user.php
- Only Homepage not loading properly
- Cron job not firing
- New User Form – Custom Menu Page
- finding whether request is for post, and post id
- How to redirect a URL with parameters?
- Anonymous Postings
- Problem using Press-this book marklet
- Can’t delete Draft Post [closed]
- Outbound link autometic converted into linkdirect , and not opening
- WordPress site periodically goes down
- Contact Form 7 Get Image Function [closed]
- Checkbox conflict in my custom plugin admin page
- WP Plugins – Use includes to display page content
- Recent posts per category loop?
- Problem of encoding characters (apostrophes) in my posts publications
- How to backup single post in wordpress [closed]
- Is there a way to make the main page only display a brief description of the full article?
- How to change the post form from plugin?
- Allowing users to Sign-up > Login > Post articles that need approval
- XML Sitemap Generator can’t notify google and bing
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Is there a plugin or a way in the wordpress that would let us have different versions of a post or page accessibe to users?
- download button for audio file in post [closed]
- Print posts category or tag as a formatted journal
- Classic, but puzzling “The uploaded file could not be moved”
- Post deleted in trash [closed]
- How to relate 3 wordpress components with each other (Create database relationships)
- Apparent errer when installing plugin
- problem with register_activation_hook in plugin
- Is it save to replace with in WordPress search form
- How to get Recent Post From Each Category with Thumbnail?
- All new plugins generating 311 chars of unexpected output?
- What snippet do I need to type to show my ACF field show up on my theme?
- Is there a way to make [Table Of Content] plugin while not using revision data?
- Is it possible to pin a post in second position from top
- page duplication on wordpress that wont stop
- How to change my 3000 Published post status to Draft using PHPMyAdmin
- login form should redirect to register page for in 1st login next time it should redirected to home page
- How to get data from a form on a wordpress site?
- WP search box on page not finding .PDF files
- How can I see $post object in frontend from functions.php?
- Allow members to create groups on my site
- wp_set_password() does not work!
- ERROR message: “The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.”
- Object of class WP_Error could not be converted to string in /formatting.php
- How to send custom mail when a user complete a specific form
- Cannot modify header information – headers already sent during plugin activation
- Ajax call to php function doesn’t work PHP code
- After form submission want to show success message in the form page
- Pause form submissions while upgrading plugins
- Warning: Illegal offset type in /var/www/html/wp-includes/option.php on line 1924
- How to force regenerate thumbnails in WordPress posts?
- Publish Post but don’t call publish hook in foreground post creation
- I created a custom form in HTML/CSS and now I need it to submit … should I create custom PHP or is there a plugin I can use?
- Form submit from wordpress plugin
- Serialize $_POST global in wordpress
- wordpress option page data from select form is not saving to database
- How to use shortcode of any plugin to show it visually where i want?
- A plugin is giving me “You do not have sufficient permissions to access this page.” error
- WordPress not updating post or disable plugin instead a white page appear
- Restore Category Base
- get post excerpt by query
- Internationalization of Blog Posts
- Issues with Post 2 Post Plugin
- Custom Form only for admin
- How to add character to content of post?
- Custom feed parameters / Template overriding
- Plugin to display text before a post
- Can’t edit Contact Us form on front page
- Change from blogger to wordpress
- how to show selected options drop down menu values in attributes field in after saving post.php
- How can I resolve an error on WordPress after PHP update
- How can I add a zip code service availability checker in WordPress without Woocommerce? [closed]
- Getting 400 Error in wordpress website