Re: [SMARTY] include_php file with paramters?

From: Date: Thu, 07 Nov 2002 14:49:48 +0000
Subject: Re: [SMARTY] include_php file with paramters?
References: 1 2 3 4 5  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6357@lists.php.net to get a copy of this message
Hi, my external newsscript (not my own coding :) ) doesn't use HTTP_GET_VARS either $_GET. That was the problem. Now i code in this script my own solution. readable in the last message in this thread. Parameter: $newsid = $_GET['newsid']; ... Now the newsscript get the parameter like $newsid, $action etc. ... The solution is simple. I didn't want to write a new plugin or function. Thank you for your effort. ksi "André Rabold" schrieb: > > $_GET was introduced in PHP 4.1.0. It's nearly the same as $HTTP_GET_VARS > (see below). > If you use $HTTP_GET_VARS in your scripts you should modify my function and > copy $_GET into $HTTP_GET_VARS near the end of the function. Then it should > work > > The $_POST variable isn't modified at all because $_POST (like > $HTTP_POST_VARS) contains > only vars posted via a html form. > > The $_REQUEST variable contains all user set variables in one ($_GET, > $_POST, $_SESSION, etc.) > like the $HTTP_REQUEST_VARS. > > Some PHP users enable the "register_globals" directive (not recommended!!!). > If you want my function > to behave like this you whould extract the $_GET variable at the end of the > function. > > If I have time (today or tomorrow) I'll update the function to support all > of the features meantioned here. > > Here's a part of the PHP help which should explain the differences between > $_GET and $HTTP_GET_VARS (the same for $_POST and $HTTP_POST_VARS etc.): > > <<<<snip>>>> > HTTP GET variables: $_GET > Note: > Introduced in 4.1.0. In earlier versions, use $HTTP_GET_VARS. > An associative array of variables passed to the current script via the HTTP > GET method. Automatically global in any scope. > This is a 'superglobal', or automatic global, variable. This simply means > that it is available in all scopes throughout a script. You don't need to do > a global $_GET; to access it within functions or methods, as you do with > $HTTP_GET_VARS. > $HTTP_GET_VARS contains the same initial information, but is not an > autoglobal. (Note that HTTP_GET_VARS and $_GET are different variables and > that PHP handles them as such) > If the register_globals directive is set, then these variables will also be > made available in the global scope of the script; i.e., separate from the > $_GET and $HTTP_GET_VARS arrays. For related information, see the security > chapter titled Using Register Globals. These individual globals are not > autoglobals. > <<<<snip>>>> > > "Kai-Uwe Beyer" <Kai-Uwe.Beyer@SVI.de> schrieb im Newsbeitrag > news:3DCA16E1.D206A43A@SVI.de... > > > > > > "André Rabold" schrieb: > > > > > > That's right. For this reason I have implemented a forward functions > which > > > makes it possible > > > to include php scripts with additional parameters: > > > > > > > > > forward('http://www.example.com/mypage.php?myparam1=1&myparam2=2'); > > > > quite good idea :) > > > > > > > > It includes the page "mypage.php" and then modifies the $_POST, $_GET > and > > > $_REQUEST > > > variables so the script will recognize the parameters. > > > > Why your script does modify the $_POST and $_GET parameters? I don't > > understand the meaning of this. > > > > ksi > > > > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.general (#6357) next »