|
Posted by Rik on 01/12/07 11:00
TMN wrote:
> Erwin Moller wrote:
>>> The include works and finds 'displayIncidents.php' instead of
>>> trying
>>> to find 'displayIncidents.php&delete=true' - is this because I used
>>> urlencode ?
>>
>> No, that is simply because your URL contains a few name-value pairs,
>> seperated by &.
>> You extract one of them, as you did, via $_GET["somename"].
>>
>> The URLencoding only make sure that the value you are posting is
>> valid for passing around via url.
>>
>> [GOOD]
>> $url .= "?$name1=".urlencode($value1)."&$name2=".urlendode($value2);
>>
>> This will end up with an url that replaced all naughty characters
>> with url-encoded characters tat are OK to use in an url.
> No more top posting for me !!!!!
Hear, hear! :-)
> Thanks for the explanation - in displayIncidents.php I can do this:
> $showDelete = $_GET["delete"];
> So the php function "include" knows to parse the name-value pairs and
> the url ?
The variables are already parsed at the beginning. All variables in the
scope the include is called in (so global scope if called in global, the
scope of a function if called in that) are available to the included
script.
Furthermore, the $_GET ($_POST/$_SERVER/$_SESSION/$_REQUEST/$_ENV) are
'superglobals', which means you can access them directly from any point in
the script(s), they're always in scope.
--
Rik Wasmus
Navigation:
[Reply to this message]
|