[pmwiki-users] $PreviousPage variable?

Sivakatirswami katir at hindu.org
Sun Aug 12 21:06:49 CDT 2007


Martin Fick wrote:

> Yes, but you can always just make a patch file,
> hopefully it will continue to apply cleanly.

how do you make a "patch file" (I'm PHP ignorant)
that would insert a single line

$qf .= $qf ? "&":"?" . "PreviousPage=$pagename";

in that exact location? :

>>  Toward
>>  > the end of the LinkPage function, add this line:
>>  >
>>  > $qf .= $qf ? "&":"?" .
> "PreviousPage=$pagename";
>> Assuming I get the page to work.. the previous
>> page URL will be in which var?  $PreviousPage ?
> 
> Assuming that you install the HttpVariables recipe, it
> will be in the {$?PreviousPage} variable, but named it
> what you like (note the question mark, "?", after the
> dollar, "$", which means GET variable).
> 
> If you don't want to install the complete
> HttpVaraibles recipe (although it is very small), you
> could also just define a custom pagevariable in your
> config.php to access the GET variable, something like
> this:
> 
>   $FmtPV['$PreviousPage'] = '$_GET["PreviousPage"]';

hmmm. I have no problem installing the complete recipe,
but, for clarity's sake: are you saying that  '$_GET["PreviousPage"]'
is available to the PMwiki  as a global  environment variable
even without httpVariables.php loaded? i.e. what do you
mean by "don't... install the complete HttpVariables recipe?"

> See the section on custom pagevariables here:
> http://www.pmwiki.org/wiki/PmWiki/PageVariables
> If you do this, it will be accessed without the "?":
> {$PreviousPage}

I looked thru those doc pages before, and I think it's clear
but saw no mention of access to Apache http environment
variables  -- which I understand to be the array below
that I get from a revolution echo globals cgi. which are normally
accessible to any cgi language and I'm assuming PHP as well.
"HTTP_REFERRER" is not on this list but would be in other contexts


> 
> Cheers,

Thanks again... I think I can make this work... I do
like to know what I'm doing though, so that I
don't install a sponge in the patients heart during
surgery (smile)


> -Martin

Sivakatirswami

$SCRIPT_NAME = /cgi-bin/echo.cgi
$REQUEST_URI = /cgi-bin/echo.cgi?getString
$QUERY_STRING = getString
$REQUEST_METHOD = GET
$SERVER_PROTOCOL = HTTP/1.1
$GATEWAY_INTERFACE = CGI/1.1
$REMOTE_PORT = *********
$SCRIPT_FILENAME = /var/www/vhosts/himalayanacademy.com/cgi-bin/echo.cgi
$SERVER_ADMIN = katir at hindu.org
$DOCUMENT_ROOT = /var/www/vhosts/himalayanacademy.com/httpdocs
$REMOTE_ADDR = **********
$SERVER_PORT = 80
$SERVER_ADDR = **********
$SERVER_NAME = www.himalayanacademy.com
$SERVER_SOFTWARE = Apache/2.0.53 (Fedora)
$HTTP_COOKIE =
__utmz=30606630.1185653021.340.28.utmccn=(referral)|utmcsr=192.168.1.254|utmcct=/userLogin.html|utmcmd=referral; 

htscallerid=47fc18883c846e5f992ce5c259d23b45;
__utma=30606630.1449052949.1177703082.1186632094.1186715875.375;
__utmc=30606630
$HTTP_CONNECTION = keep-alive
$HTTP_KEEP_ALIVE = 300
$HTTP_ACCEPT_CHARSET = ISO-8859-1,utf-8;q=0.7,*;q=0.7
$HTTP_ACCEPT_ENCODING = gzip,deflate
$HTTP_ACCEPT_LANGUAGE = en-us,en;q=0.5
$HTTP_ACCEPT =
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
$HTTP_USER_AGENT = Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US;
rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
$HTTP_HOST = www.himalayanacademy.com
$PATH = /usr/local/bin:/usr/bin:/bin
$1 = getString
$0 = echo.cgi






More information about the pmwiki-users mailing list