RE: [PHP-DB] Problems with formvalues by using Suse 8.2
| From: | Gary dot Every at ingramentertainment dot com | Date: | Thu, 19 Jun 2003 20:34:04 +0000 |
| Subject: | RE: [PHP-DB] Problems with formvalues by using Suse 8.2 | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-28751@lists.php.net to get a copy of this message | ||
To protect yourself by keeping register_globals off but still have access to
your GET and POST info, do the following:
<snip>
foreach($_POST as $key=>$value) {
$$key = $value;
}
// Now all the post vars are in their corresponding key names
// You can do the same with $_GET vars
</snip>
Using the $$key assigns whatever $key is to a variable with that value, e.g.
$key = "sid";
$value = "W1111";
So:
$$key = $value;
will make the following true:
$sid == "W1111";
It's a pretty good way of re-doing pages that were written with
register_globals=on to run with register_globals=off
Gary Every
Sr. UNIX Administrator
Ingram Entertainment
(615) 287-4876
"Pay It Forward"
mailto:gary.every@ingramentertainment.com
http://accessingram.com
> -----Original Message-----
> From: Thorsten Körner [mailto:thorstenkoerner@123tkshop.org]
> Sent: Thursday, June 19, 2003 2:05 PM
> To: php-db@lists.php.net
> Subject: Re: [PHP-DB] Problems with formvalues by using Suse 8.2
>
>
> Hi
> Am Donnerstag, 19. Juni 2003 20:07 schrieb Ruprecht Helms:
> > Hi,
> >
> > under using Suse 8.2 I've the problem that the values of
> formfields will be
> > put out or worked withit within a phpscript.
> >
> > The testscript with phpinfo() is working fine.
> >
> > What have I to set (in the php.ini) that php is handling the
> > formfieldvalues properly?
> Seems to be a little bit OT here.
> Your question is not very precise, but I'll give it a try.
> Depending on your form-method, you can request the values by
> accessing either
> $_GET['formfieldname'] or $_POST['formfieldname'] where
> formfieldname has to
> be replaced by the real names of the fields.
> Hope that's it.
>
> CU
>
> Thorsten
> --
> Thorsten Körner http://www.123tkShop.org
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>