I'm trying to figure out how to capture data from a form that exists inside a function, and then use it inside another php function. Here's the setup for my .php file:
function setPrice( ) { I want to store the form data inside $variables here }
function shortcode( ) { the form is inside this function; there is an input field whose data I would like to use in setPrice }
The form is in one page of my website. When the user submits the form, they are taken to another page (a cart page).
I've tried using $_POST['input-name'], but that hasn't worked. I read about using sessions, but I don't know how to implement that in my case since I'm using two functions there.
Can anyone help me out? Thanks!