maxic0 Posted April 1, 2007 Share Posted April 1, 2007 Right.. this isnt a big problem but it would be nice if it was sorted.. I have a site made with Css/html/php. In the center content part i have a switch statment thats gets the web address thing and includes a page according to that web address. To the right i have a users station box, it has an IF statment, if $_SESSION['username'] is set then it echos out 'Edit Profile', 'Account Details' and stuff like that. If $_SESSION['username'] isnt set then it echos out a login form. Now the problem is that when they click the submit button to login the web address is then www.site.com/index.php?page=loginckeck and in the center it says 'You are now logged in' or whatever the case may be. If they login in correctly then it says they are loggin in but the users station at the side still has the login form until i click onto another page. How do i change the users station box to show the right things as soon as they've logged in? Thanks (Hope you understand my problem). Link to comment https://forums.phpfreaks.com/topic/45184-login-stuff/ Share on other sites More sharing options...
Lumio Posted April 1, 2007 Share Posted April 1, 2007 Make a redirect using header('Location: index.php'); or something like that. You need to do that in the beginning of you login-script. Link to comment https://forums.phpfreaks.com/topic/45184-login-stuff/#findComment-219354 Share on other sites More sharing options...
maxic0 Posted April 1, 2007 Author Share Posted April 1, 2007 Thanks for the fast reply. I get an error though saying Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\site\index.php:13) in C:\wamp\www\site\page.php on line 2 Link to comment https://forums.phpfreaks.com/topic/45184-login-stuff/#findComment-219359 Share on other sites More sharing options...
Lumio Posted April 1, 2007 Share Posted April 1, 2007 Make a redirect using header('Location: index.php'); or something like that. You need to do that in the beginning of you login-script. I told you to make that function in the very top of a document. If you have some html-code in the beginning or you make some outputs by echo, print, ... then you get that error you posted. Link to comment https://forums.phpfreaks.com/topic/45184-login-stuff/#findComment-219360 Share on other sites More sharing options...
DeathStar Posted April 1, 2007 Share Posted April 1, 2007 why nt make live easy? meta refresh content. to lazy to write the code now XD Link to comment https://forums.phpfreaks.com/topic/45184-login-stuff/#findComment-219361 Share on other sites More sharing options...
maxic0 Posted April 1, 2007 Author Share Posted April 1, 2007 it is the first thing, its on line two cause the first line is "<?php" Link to comment https://forums.phpfreaks.com/topic/45184-login-stuff/#findComment-219368 Share on other sites More sharing options...
DeathStar Posted April 1, 2007 Share Posted April 1, 2007 echo "<meta http-equiv=\"refresh\" content=\"2;url=index.php\">";[code] [/code] Link to comment https://forums.phpfreaks.com/topic/45184-login-stuff/#findComment-219372 Share on other sites More sharing options...
maxic0 Posted April 1, 2007 Author Share Posted April 1, 2007 Thanks.. Works a treat! Link to comment https://forums.phpfreaks.com/topic/45184-login-stuff/#findComment-219377 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.