PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
hI GUYS,
i HAVE A REDIRECT FILE redir.php
which uses session_start();
then
$_SESSION['username'] = "username";
$_SESSION['password']="password";
then header(Location:http:localhost/...");
When I am redirected after IO have called session_start();
and echo $_SESSION['username'];
I get no result;
No man. I have session_start() called at the top of my file(redir.php)
Then set sessions
Then Redirect.
When I print_r($_SESSION);
I have empty array:Array();
I'd try changing as many things as possible to see if you can narrow down the problem. Try the same code on another server first of all, then try a different browser. Apart from those suggestions I'm all out.
Hi guys,
I have fixed it to some extent. I have removed everything and left just these three lines of code and it worked but not on myt localhost and after I have checked the server's logs I saw an error:Premature end of script headers but I do not know what might have caused it.
Any suggestions.