From: Boris Z. <bo...@2b...> - 2004-11-19 17:11:36
|
Hi Alex, Am Freitag, 19. November 2004 15:40 schrieb Alex Deva: > The env var seems to not be set all the time. This might be because I'm > reaching the page via http redirect, and you never know (or do you?) > > Boris, the correctly spelled method is "header_in" and it works like so: > > my $referer = $apr->header_in('Referer'); > This works only with apache1. apache2 and apache1 should support my $href = $apr->headers_in; here is a example: Maybe you did not see the header, since the client must not send the referer header. #### Modelcode ###### # show all headers sub alex { my $model = shift; my $href = $model->apr->headers_in; $model->output( headers => [ map { +{ name => $_, value => $href->{$_} } } sort keys %$href ] ); } ######### alex.tmpl ######### <html> <body> <model_loop headers> <model_var name> <model_var value><br> </model_loop> </body> </html> ####### output ( ignore ) ########### Accept */* Accept-Encoding gzip, deflate;q=1.0, identity;q=0.5, *;q=0 Accept-Language de-de, ja;q=0.77, en;q=0.92, nl-nl;q=0.88, nl;q=0.85, ja-jp;q=0.81, de;q=0.96, fr;q=0.73, es;q=0.69, it-it;q=0.65, it;q=0.62, sv-se;q=0.58, sv;q=0.54, no-no;q=0.50, no;q=0.46, da-dk;q=0.42, da;q=0.38, fi-fi;q=0.35, fi;q=0.31 Connection keep-alive Cookie pkit_session_id=fdb814523909709a3a697ee14fbcc1a0 Host localhost:8529 User-Agent Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/125.5.5 (KHTML, like Gecko) Safari/125.11 > (I've just found that out, I didn't know about it, thank you!) > > but... still no result. > > Thanks anyway. > > > ----- Original Message ----- > From: <sh...@ru...> > To: "Alex Deva" <al...@dr...> > Cc: "Boris Zentner" <bz...@2b...>; "PageKit Users" > <pag...@li...> > Sent: Friday, November 19, 2004 4:33 PM > Subject: Re: [Pagekit-users] referral field in the http request > > > If you mean the HTTP referer information, you can get that out of the > > runtime environment: > > > > $ENV{'HTTP_REFERER'} > > > > A google search randomly turned up this page, which has a useful list and > > is > > > running under mod_perl: > > > > http://www.cis.ksu.edu/~aruljohn/cgi-bin/env.cgi > > > > If that page stops working try another search for "mod_perl environment > > variable list". > > > > Good luck! > > > > shimon. > > > > On Fri, Nov 19, 2004 at 04:09:05PM +0200, Alex Deva wrote: > > > Hi, > > > > > > Can I access the 'referral' field, or indeed the HTTP request header at > > all? > > > > There seems to be no method for that (or at least one that would return > > a > > > > CGI object, or something) > > > > > > Thanks! > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by: InterSystems CACHE > > > FREE OODBMS DOWNLOAD - A multidimensional database that combines > > > robust object and relational technologies, making it a perfect match > > > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > > > _______________________________________________ > > > Pagekit-users mailing list > > > Pag...@li... > > > https://lists.sourceforge.net/lists/listinfo/pagekit-users > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: InterSystems CACHE > > FREE OODBMS DOWNLOAD - A multidimensional database that combines > > robust object and relational technologies, making it a perfect match > > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > > _______________________________________________ > > Pagekit-users mailing list > > Pag...@li... > > https://lists.sourceforge.net/lists/listinfo/pagekit-users > > ------------------------------------------------------- > This SF.Net email is sponsored by: InterSystems CACHE > FREE OODBMS DOWNLOAD - A multidimensional database that combines > robust object and relational technologies, making it a perfect match > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > _______________________________________________ > Pagekit-users mailing list > Pag...@li... > https://lists.sourceforge.net/lists/listinfo/pagekit-users -- Boris |