I have a form that users fill out. When they finish, they are redirected to a 3rd party site to set up payment options. After completing the payment process, they are sent back to my site with a variety of $_POST variables.

My plugin needs to create a thank you page based on those POST variables. It's a simple little page with a title and a few paragraphs of text.

I do not want these pages to be stored in the database. They will be unique to each transaction.

I attached a function to init that parses the $_POST data (after sanitizing, of course.) That function creates two global variables: $my_title and $my_content I'm not sure how to turn those into a page for the user, though.

Would you be okay with one page in the WordPress db? If so you could set up a single "thank you" page which uses a custom page template. Put the code in that template to pull in the args from the querystring and display your custom content.
–
MichelleSep 13 '11 at 16:11

Yeah, that would work. I'm trying to do it all without touching the theme... if that's what has to happen, so be it. But, I'd like it to be one self-contained plugin.
–
Peter GSep 13 '11 at 16:21

That looks like what I need, but it's not quite working for me. Looking at the debug info, I added lines for $post->post_name and $wp_query->queried_object_id. Now the result is it shows the blog index and gives the notice Trying to get property of non-object in .../wp-includes/post-template.php on line 485 It looks to be trying to look up the page with id = -99, which fails. Any ideas?
–
Peter GSep 13 '11 at 21:08

I tried setting the fake page ID equal to 1. That cleared up the notice, but still just showing the blog index.
–
Peter GSep 13 '11 at 21:15

@Peter G - sorry, don't know how to fix that, will have to do some tests myself later.
–
MiloSep 14 '11 at 1:16

Thanks @Milo I've been trying to use it on all sorts of different hooks without luck. It seems like such a simple idea, but apparently not. I'd love an answer to this, but given time constraints I'll likely go the custom template route suggested above sometime tomorrow.
–
Peter GSep 14 '11 at 2:08

The template method worked out for me and got the job done. I'm accepting this answer because it does show how to set up your own $post & $wp_query variables.
–
Peter GSep 17 '11 at 17:59