Jump to content

Login Stuff..


maxic0

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.