[wp-hackers] Frontend form

Eric Mann eric at eam.me
Thu Aug 18 18:18:31 UTC 2011


We'd have to see what code you're using in the form to diagnose the "Headers
already sent" issue, but typically this is due to either `echo`ing content
too early in WP's execution or trying to modify the page headers too late in
WP's execution.

My guess is that you're trying to use some kind of HTTP redirect within the
content of the page ...

As for preventing the browser's back button ... don't.  It's bad form to
modify the behavior of the browser like that, and the user might have a
legitimate reason to use the back button.  Instead, just validate the form
to prevent duplicate submissions - i.e. use a nonce to detect whether or not
this is a repeat submission and reject the re-submission.

On Thu, Aug 18, 2011 at 10:51 AM, Diana K. Cury <dianakac at gmail.com> wrote:

> I have a working frontend form, for create post types.
>
> Using as a template for pages: works nice, I'm able to create the post I
> get redirected to the them right after the process.
>
> When I tried to implement this form as a plugin shortcode, I got "Headers
> alredy sent ". The post is created as well, but doesn't redirect to the
> post.
>
> Also, is there someway to prevent going back in history and re-submit the
> form again? I know there's a lot of plugin for this, but that is a very
> simples static form.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list