|
Posted by David Haynes on 06/25/06 15:10
frothpoker wrote:
> Guys,
>
> I have a couple of issues which I am hoping you can provide guidance
> on...
>
> First one:- Is there any way to retain the $_POST values when a user
> navigates between pages without using <form method = 'post'>
>
> I want to be able to track the user from one page to another to provide
> customised content. I could make all navigation buttons as forms but
> its a bit of a pain in the proverbials
Use a SESSION to store the values you want to remember.
> Second one, which is related to the first:-
>
> I have submitted and validated data in a form where the action is
> $PHP_SELF.
>
> I need to insert a record into a database.
>
> The user will have selected a venue which may have more than one event.
> The validation checks the database for the number of events and if
> there is only one, chooses that as the default. If there is more than
> one then it needs to display another form to select the correct event
> but I obviously need to pass all the $_POST values through this new
> form so that I can insert it into the database... Should I just
> iterate through the $_POST array with hidden fields on the form, or can
> I pass the whole array through while adding array elements to it?
Again SESSION would be your friend here.
Think of it this way. The browser may pass data to the php program using
either POST or GET methods. PHP programs may pass data using the SESSION
to other PHP programs.
The 'short cut' of using PHP_SELF and the browser-passed variables is
just that - a short cut.
-david-
Navigation:
[Reply to this message]
|