RE: Problems with formvalues by using Suse 8.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:  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
> 

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux