perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <gyo...@laserlink.net>
Subject RE: Antwort: http or https in URL?
Date Tue, 06 Nov 2001 16:36:45 GMT

> 
> sub savelink ($modul: string min 4 max 4, $page: string 
> default index.html) {
>   my $r = Apache->request;
>   my $session_id = $r->pnotes('sessionid');
> 
>   my $uri = Apache::URI->parse($r);
>   my $hostinfo = $uri->hostinfo;
>   my $scheme =  $uri->scheme;
> 
>   my $url = $scheme . '://' .
>             $hostinfo . '/'.
>             $session_id . '/' .
>             $GAD::SessionMgr::DIR_PREFIX . '/' .
>             $modul . '/' .
>             $page;
> 
>   return $url;
> }

egads.  use the $uri object methods to set all the parts then call
$uri->unparse to get the URI back.

my $uri = Apache::URI->parse($r);
$uri->path(join "/", $session_id, $GAD::SessionMgr::DIR_PREFIX, $module,
$page);
return $uri->unparse;

--Geoff


Mime
View raw message