WA
12-13-2002, 12:19 PM
Hi:
In PHP4.2+, I was wondering what the "standard" technique is to registering a post/get variable as a session variable, for example a username entered by the user to be shown on all other pages of site. The fact that the variable must now be assessed via an array is where my dilemma comes in. Doing something like:
session_register("$_POST['username']");
doesn't work, both syntactically and logically; for the later, since the above registers a POST variable, one which may never have been entered in the first place by the user if you calls up a page without the login form.
I guess what I'm asking is, is the technique in PHP4.2 to always save a POST variable as a local variable first, then register it? In other words, there's no way to cut a step and directly register a POST variable and use it elsewhere on the site?
Thanks,
In PHP4.2+, I was wondering what the "standard" technique is to registering a post/get variable as a session variable, for example a username entered by the user to be shown on all other pages of site. The fact that the variable must now be assessed via an array is where my dilemma comes in. Doing something like:
session_register("$_POST['username']");
doesn't work, both syntactically and logically; for the later, since the above registers a POST variable, one which may never have been entered in the first place by the user if you calls up a page without the login form.
I guess what I'm asking is, is the technique in PHP4.2 to always save a POST variable as a local variable first, then register it? In other words, there's no way to cut a step and directly register a POST variable and use it elsewhere on the site?
Thanks,