You define the variable name when you're setting up the query string on the confirmation settings.. it can be pretty much whatever you would like, you just have to define it there, then call that name where you want it to appear in the page.
example query string:
sitename={Site Name:1}&websiteurl={Website URL:3}&pubdate={Date:5}
you could call the site name variable "foo" if you wanted, as long as it's passing the value from the correct field. If you did, you'd simply get the value for "foo" from the querystring.
<?php echo $_GET["foo"]; ?>
Note: these variable names are reserved for WP functions and you can't use them.
m, p, post_parent, subpost, subpost_id, attachment, attachment_id, name, hour, static, pagename, page_id, second, minute, hour, day, monthnum, year, w, category_name, tag, cat, tag_id, author, author_name, feed, tb, paged, comments_popup, meta_key, meta_value, preview
As far as placing the content on the page, you will most likely want to create a new page template (actual php file) to place the form and the new content on. Unless you have a plugin like PHP Exec running, you can't normally execute php from within the content field.
If you do create a new page template, remember to associate it with the page in the WP admin (on right sidebar).
You can place your code snippet wherever you would like on the new page template. It's really up to you. In my quick test, I just put it below the "the_content" token.
<div class="post-content">
<?php the_content(); ?>
<!-- begin form output -->
<div>
<?php echo $_GET["sitename"]; ?>
<?php echo $_GET["websiteurl"]; ?>
<?php echo $_GET["pubdate"]; ?>
</div>
<!-- end form output -->
</div>
Hope that helps.
Posted 15 years ago on Tuesday October 20, 2009 |
Permalink