Extract form field names when they're not known in advance

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beary
    New Member
    • Nov 2006
    • 170

    Extract form field names when they're not known in advance

    I have a page with a form which has automatically generated fields, (which come from mysql column names). There could be any number of these fields, and I have no way of knowing exactly what they're called. But obviously I need to know their names, in order to extract their values on the submission page.

    They are either of the form c%status#, e%status# or t%status#

    % is a number between 1 and 13 (inclusive)
    # could be anything in the pattern 01, 02, 03, with no limit

    Eg: fields could be c2status03 and e4status07, but I don't know this in advance. These would be generated on the fly from mysql.

    But on the submission page I need to be able to generate the code $var1=$_POST['c2status'] and $var2=$_POST['e4status07']

    Is there a way for me to somehow get these names so I can extract their values on the submission page? Or have I hit a dead end?
  • merseyside
    New Member
    • Mar 2007
    • 48

    #2
    Hav you tried a foreach on $_POST?

    Comment

    Working...