Single page php (using post values for logic) or multiple pages
I'm in the process of building a custom page for my pfSense captive portal. I have some codes generated and using the default page they work fine so I'm happy that is all ok. When I upload my own version of a basic auth page with just a form posting to $PORTAL_ACTIONS with an auth_voucher text box it also works just fine.
Where I am struggling is if I try and do anything more complicated than that. My code works fine and is tested on a separate webserver but does not seem to want to play on pfSense. Using php on pfsense CE 2.5.1.
What I want is to have a form that gives 3 options
1/ I have a voucher
2/ I want a 24 hour pass
3/ I wan a 1 week pass
Then when the page is submitted display either an "enter your voucher" form or a payment form. The payment form would then upon success grab a voucher and post to $PORTAL_ACTIONS with the voucher.
I tried posting back using $_SERVER["PHP_SELF"] then checking the $_POST values to decide which form to display. Works fine on a "normal" webserver (so I know my code is good) but when I try on pfSense after clicking the submit button the page clears and the next page never loads.
Also tried pulling "step2" out into a separate file and uploading that using the file uploader. Now the submit button just reloads the main CP page but says it's step2.php. The same occurs when I try captiveportal_step2.php rather than just step2.php.
I'm fairly sure that there is something really obvious that I am missing but I am really struggling to work out what it is.
Any help would be appreciated.