Re: $_GET

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

 



2009/4/12 Ron Piggott <ron.php@xxxxxxxxxxxxxxxxxx>:
>
> At the very start of my index.php I have the following lines of code:
>
> foreach($_GET as $key => $val) {
> $$key = $_GET[$val];
> echo $_GET[$val] . "<br />";
> }
>
> What I don't understand is why the output is
>
> <br /><br />
>

Well, this would happen if you open
/page.php?var=

that way the var is set and a part of the _GET Array. You might want
to check the variables with empty() or isset().

Remeber to escape strings recieved by users (GET-, POST-, COOKIE-Data
as well as some server vars like REMOTE_ADDR, PHP_SELF, etc.)


byebye

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux