Alexis Antonakis wrote: > Hi, > > I am trying to register an array in a session, but am having no luck. > > > What I have is a form with set fields on which is processed a certain number > of times. > > > Upon submitting the form each time, I run the following: > > session_register("fieldtext[".$page."]"); > > where fieldtext is the name of a field on the form, and $page is the page > number, which increases by one each time the form is submitted. > > > All I get registered is the last value submitted on the form, all the > previous values are null. > > Any advice would be most appreciated. > > TIA > Alexis >
Try simply registering "fieldtext" and refer to the array within the code as $fieldtext['key']; Also, if you are using a recent version of PHP, there is no need to register session variables. You can make use of $_SESSION and store arrays within it, for example $_SESSION['fieldtext']['key']; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php