fargin sessions...
| From: | motorpsychkill | Date: | Fri, 04 May 2001 13:43:10 +0000 |
| Subject: | fargin sessions... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-51410@lists.php.net to get a copy of this message | ||
If anybody is remotely interested, this is how I got php 4.0.4 to do
sessions without cookies and with register_globals=OFF. Tested on IE
4.something (I'm not really coherent right now ;) and Netscape 4.5. This
took me a while to figure out and thought it might help save someone else
the trouble. Let me know if you can improve upon this...
//---------------------------------sess01.php
<?php
session_start();
session_register('varA');
session_register('varB');
?>
<form action="sess02.php">
first name:<input type="text" name="varA">
<br>
last name:<input type="text" name="varB">
<input type="submit" value="send">
</form>
//---------------------------------sess02.php
<?php
session_start();
$varA=$HTTP_GET_VARS['varA'];
$varB=$HTTP_GET_VARS['varB'];
$GLOBALS['HTTP_SESSION_VARS']['varA'] = $varA;
$GLOBALS['HTTP_SESSION_VARS']['varB'] = $varB;
echo $HTTP_SESSION_VARS['varA'];
echo $HTTP_SESSION_VARS['varB'];
?>