|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-10-19 11:04 UTC] ipa4-2001 at lycos dot com
I want to make the use of session in PHP (4.2.1) so I try this code...
session_start();
$_SESSION['user'] = 'myname';
$_SESSION['password'] = 'mypassword';
which is similar to the following...
$user = 'myname';
$password = 'mypassword';
session_start();
session_register('user');
session_register('password');
The problem comes when I add header() function so that the script become...
session_start();
$_SESSION['user'] = 'myname';
$_SESSION['password'] = 'mypassword';
header('Location: http://www.mysite.info/member/index.php');
When I try this (on IE 5.5, Windows 98SE; Apache 1.3.26), it didn't take me to the page I specified above. It led to an error message "The requested URL could not be retrieved".
I don't meet any solution of that so I think it's a bug. Can anyone help me explaining what's going on?
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 07:00:02 2025 UTC |
Hi, I also experience this problem. I am running PHP 4.2.3 on FreeBSD 4.7-PRERELEASE, with Apache 1.3.27. I have tested this with IE 6.0.2600.0000, running on Windows 2000 server SP2. The following code works for me: <?php $dlfile = "./temp.zip"; header("Content-Type: application/download-script-by-hex\n"); header("Content-Disposition: attachment; filename=\"$dlfile\""); header("Content-Transfer-Encoding: binary"); ?> But, fails as soon as I add session_start(). <?php session_start(); $dlfile = "./temp.zip"; header("Content-Type: application/download-script-by-hex\n"); header("Content-Disposition: attachment; filename=\"$dlfile\""); header("Content-Transfer-Encoding: binary"); ?> Also, in lynx (FreeBSD 4.7-PRERELEASE) I can download the file, but, I get a 4 byte Ascii file, the spaces. When I remove the session_start(), I get a Ascii file that is 10 bytes bigger than the origional, the new file also filled with spaces. Am I just missing something here, or is this a bug ? Thank you. Regards Jaco van Tonder