Re: [SMARTY] sessions

From: Date: Fri, 17 May 2002 11:26:23 +0000
Subject: Re: [SMARTY] sessions
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4272@lists.php.net to get a copy of this message
most of my links are back to the script itself (I tend to contain everything related to a given application in a single file). I use the following function like this: $t->assign('SELFLINK',phpself()); /** * return a url to the current script, caring about the sid if defined * * @author Jason E. Sweat * @since 2002-04-07 * @return string the php_self url */ function phpself() { global $sid; $protocol = 'http'; if (443 == $_SERVER['SERVER_PORT']) { $protocol .= 's'; } $ret = $protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'; if (isset($sid)) { $ret .= "sid={$sid}&"; } return $ret; } ----- Original Message ----- From: "Blue Presley" <blue928@carolina.rr.com> To: <smarty-general@lists.php.net> Sent: Friday, May 17, 2002 1:08 AM Subject: [SMARTY] sessions I'm using php 4.2 with transparent session id enables. I'm having trouble getting the session id to append the url of my subsequent pages after the session has started. within normal php pages, the SID is automatically attached to the url, but using it through smarty this is not happening. I've tried something like $smarty->assign("sessid", session_id()) but i'm not getting the variables to pass correctly. anyone else out there correctly using sessions and smarty? thanks in advance for your help. blue

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