Problem with session function: URL Parameter

From: Date: Wed, 26 Sep 2001 14:19:02 +0000
Subject: Problem with session function: URL Parameter
Groups: php.db 
Request: Send a blank email to php-db+get-12725@lists.php.net to get a copy of this message
I would use the session functions with URL parameter but PHP can't transmit the SID to the link-URL. This methods work: 1. <?php session_id(); session_name(); session_register("username"); session_write_close(); ?> <a href="admin/admin.phtml?<?=SID?>">next</a> Result: http://admin/admin.phtml?PHPSESSID=85e6077fd4ff6bdd738707335f283ef5 2. <?php session_id(); session_name(); session_register("username"); session_write_close(); ?> <script language="JavaScript"> function Test() { window.location.href="admin/admin.phtml?<?=SID?>"; } </script> Result: http://admin/admin.phtml?PHPSESSID=85e6077fd4ff6bdd738707335f283ef5 And this doesn't work: <?php session_id(); session_name(); session_register("username"); session_write_close(); echo("<script language=\"JavaScript\">window.location.href=\"admin/admin.phtml?<?php=SID?> \";</script>"); ?> Result: http://admin/admin.phtml?<?=SID?> PHP doesn't display the correct SID. Instead the string <?=SID?> were displayed! Thank you!!! bye

« previous php.db (#12725) next »