passing arrays
Posted: Fri Aug 16, 2002 11:33 pm
I have a function which prints an html form and populates fields with the values of an array that is passed into the function. The array is based on values in a db.
I want to use the same form to tell the user that there were submission errors after the page has posted to itself. I am thinking therefore that in this instance I want to call the function but use the values of the $_POST array to populate the fields. How can I pass the $_POST array as a whole to the function or alternatively refer to it as a default if no other array is passed e.g. something like
function myfunc($mydbarray = $_POST) where the = $_POST is the default if $mydbarray is not passed.
TIA, MW
I want to use the same form to tell the user that there were submission errors after the page has posted to itself. I am thinking therefore that in this instance I want to call the function but use the values of the $_POST array to populate the fields. How can I pass the $_POST array as a whole to the function or alternatively refer to it as a default if no other array is passed e.g. something like
function myfunc($mydbarray = $_POST) where the = $_POST is the default if $mydbarray is not passed.
TIA, MW