Re: $_GET
| From: | Jan G.B. | Date: | Tue, 14 Apr 2009 15:32:10 +0000 |
| Subject: | Re: $_GET | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-291480@lists.php.net to get a copy of this message | ||
2009/4/12 Ron Piggott <ron.php@actsministries.org>:
>
> 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