Generate page after submitting a form
-
Hello,
I have a photoblog and I want to make a redirect to buy-a-photo page from each post. On the post page a user has a choice of possible print sizes. Unfortunately I am not familiar with php at all (I am C programmer) so what I tried to do is to create a php file using a page php file from the theme as a template and change the single.php by adding the form as this:<html>
<b>Buy Fine Art Print</b><p><form name=”printordering” action=<?php echo bloginfo(‘template_directory’) . ‘/page_prices.php’ ?>>
</html>But it causes errors:
Warning: Invalid argument supplied for foreach() in C:wampwwwWordPresswp-contentthemesphotoblogpage_prices.php on line 4
( ! ) Fatal error: Call to undefined function get_header() in C:wampwwwWordPresswp-contentthemesphotoblogpage_prices.php on line 8Here is the code which causes me grieve:
<?phpglobal $options;
foreach ($options as $value) {
if (get_settings( $value[‘id’] ) === FALSE) { $$value[‘id’] = $value[‘std’]; } else { $$value[‘id’] = get_settings( $value[‘id’] ); }
}
?>
<?php get_header(); ?>I understand that probably I try to call the functions outside of CMS/Theme context but I just do not now how to do it. If someone can give me a piece of advise I would be very thankful.
regards -
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.
If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.
If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.
This is an automated message.
-
You did not have a URL but if you are changing the code you are in the wrong forum and need to make friends over at WordPress.ORG (see above for the link) – code can not be changed at WordPress.COM – a security and reliability issue.
- The topic ‘Generate page after submitting a form’ is closed to new replies.