WordPress.org

Forums

Form in a post? (2 posts)

  1. Jacob D
    Member
    Posted 5 years ago #

    Greetings. I'm not much of a WP hacker but I'm proficient with PHP.

    I have a calculator of sorts that I'd like to put into one of my blog posts. It relies on an HTML form and some PHP, and is working just fine outside of the blog. Ideally I would like the form action to point to the same url it resides at (the post in this case) so the results may be displayed there along with all of the input values. Normally this is easy enough but I'm a little lost on how to do it inside a WP post. From the reading I have done it sounds like I need the form action to point to my php processing file, and from there point back to the WP post at the end of my script... however if I do this I'll have to use session variables to pass all of variables back, and there are quite a few. I'd rather not use a session if there's another way.

    Is there another way?

    (here is a link to the broken calculator on my blog if it makes matters any clearer)
    http://dinardiengineering.com/blog/?p=42

  2. Jacob D
    Member
    Posted 5 years ago #

    ...bummed out that nobody could help. I was able to trouble shoot the problem myself and figured I would post here in case anyone else runs into this...

    The problem was not with my $_POST variables, it was with PHP Exec plugin. I was unaware of the "globals issue" with the plugin and this was causing some unexpected behavior. Linky: http://bluesome.net/post/2005/08/18/50/#globals

    I did stumble across another tip and that was to leave the form action blank ("") in order for it to post to itself.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags