Re: Glabal variables
| From: | Franco Pozzer | Date: | Mon, 28 Apr 2003 07:52:24 +0000 |
| Subject: | Re: Glabal variables | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19646@lists.php.net to get a copy of this message | ||
http://freephp.html.it/articoli/view_articolo.asp?id=86&pag=1
this article can help you.
In any way if you want to have the same code without modify it and to have
reg_glabls Off you must to use od_start to sincronyce tyhe variables and use
extract(_Array).
sample with r.globals Off
/*
variable GET $ciccio cut from query string
http://www.dominio.it/pagina.php?ciccio="bla
bla bla"
*/
echo($ciccio) ; //do not print any ant send a NOTICE
echo($_GET['ciccio']) ;// print blablabla
extract($_GET) ;
echo($ciccio) ;// this it is OK and good for security
Franco.
Harpreet wrote:
> I need to use session variables in my php application and so define then
> using
>
> <?php session_start();
> session_register("user");
>
> but for this I need to set the register_global to On. In my ini file i see
> the following comment:
>
> ; You should do your best to write your scripts so that they do not require
> ; register_globals to be on; Using form variables as globals can easily
> lead
> ; to possible security problems, if the code is not very well thought of.
> register_globals = Off
>
> What other way can i use session variables in my application.
>
> Please help,
> Thanks
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php