Eggzorcist Posted June 14, 2012 Share Posted June 14, 2012 SO here's my deal. I have a page with 2 submission buttons. The first, ask the number of fields required for the dataset. Which that submit1 creates the next form on the same page. Though, I tried re-using the $_POST variable to keep the amount of fields created to determine the amount of loops to go through for submission. But my problem is when the second submit button is pressed, that number variable is undefined. My question is how can I transmit the variable from the first form to the second? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/264184-keeping-a-variable-for-a-second-submit/ Share on other sites More sharing options...
Eggzorcist Posted June 14, 2012 Author Share Posted June 14, 2012 Here's the breakdown. I have form 1 Asks you how many fields? turns into $_post['howmany']; then I loop the form how many times... But when I put it into the database, I want to keep the howmany variable. I use the same $_post but its unidentified since a new form has been submitted... How can I transmit this variable to the second submit and second script. Both forms are $_POST $_SERVER[php_SELF]. Quote Link to comment https://forums.phpfreaks.com/topic/264184-keeping-a-variable-for-a-second-submit/#findComment-1353838 Share on other sites More sharing options...
requinix Posted June 14, 2012 Share Posted June 14, 2012 Are you familiar with hidden form fields? Quote Link to comment https://forums.phpfreaks.com/topic/264184-keeping-a-variable-for-a-second-submit/#findComment-1353840 Share on other sites More sharing options...
Eggzorcist Posted June 14, 2012 Author Share Posted June 14, 2012 No. Now I do. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/264184-keeping-a-variable-for-a-second-submit/#findComment-1353848 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.