I am trying to place php code before the header, that would have a form submit to this code to perform calculations using information in a mysql database. Once submitted, the form would populate with the inputs prior to submission and output data would be displayed below the form in a table. The plan was to allow for potential use of cookies and to also allow for a wordpress subscription plugin to be used with the calculator page. Ultimately allowing access to the calculator for subscribers only. I also have the insert php addin installed and am using this for much more simple calculations in other areas of the site. What I have tried is creating a custom template page by copying page.php and renaming with a custom name and then placing code at the top of the page. I then created a page in wordpress and used the custom template. In my custom template I simply created a variable: $testtesttest = 'Does this work?'; I then called the variable using the insert php addin on a test page within wordpress and this variable was empty. The form on this same wordpress page also did not seem to communicate with the simple test form I had created. I now have several questions regarding the templates and how I can accomplish what I am doing. Firstly, what is the most effective way I can successfully create a page that uses the features in wordpress but also allows me to perform calculations with database information before the header? I'd imagine the wordpress page does not submit to itself and include the template page, therefore the submission does not work? Is there another template page I can try using? Thanks