Re: $HTTP_POST_VARS confusion
| From: | Joe Stump | Date: | Thu, 05 Oct 2000 00:23:58 +0000 |
| Subject: | Re: $HTTP_POST_VARS confusion | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-18687@lists.php.net to get a copy of this message | ||
You could always put all of your vars in an array in the form - like this:
<INPUT TYPE="text" NAME="f[username]" VALUE="<? echo
$f['username']; ?>">
pass it to the function like this:
process_form($f);
Another *possible* solution would be to put this at the top:
while(list($key,$val) = each($HTTP_POST_VARS)){
define("$key","$val");
}
That should work :O)
--Joe
On Wed, Oct 04, 2000 at 04:31:08PM -0700, Erica Douglass wrote:
> Hello!
>
> I have a question about the variables posted in a form. Supposedly,
> register_globals in the PHP config file enables you to simply use a
> variable/value pair that was included in a posted form (such as $username.)
> However, I am using a function to process my form, and I can't seem to get
> the function to do this without adding a global declaration at the
> beginning of the function, such as global $username. This quickly becomes a
> pain as well as being non-extensible.
>
> I made sure register_globals was turned on, and I even added
> $HTTP_POST_VARS to the global declaration, but I have had no success. What
> is the right solution to this problem? (Note: I tried to figure out a
> workaround using the array generated by $HTTP_POST_VARS, but it didn't
> work. Perhaps someone has a suggestion as to how to declare variables by
> cycling through an array?)
>
> Erica
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
/*****************************\
* Joe Stump *
* www.Care2.com *
* Office: 650.328.0198 *
* Extension: 122 *
\*****************************/
http://www.miester.org/Joe/Stump/Joe_Stump_resume.html
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GB/E/IT d- s++:++ a? C++++ UL++$ P+ L+++$ E----! W+++$
N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
5? R-! tv@ b+ DI++@ D(++++) G++@ e+@ h@ r+! z(+++++**)!
------END GEEK CODE BLOCK------