开发者

PHP: Sessions check user

I'm tryin开发者_StackOverflow中文版g to make a small web society. I already got the user registration and log in scripts.

When i log in, i check if the user is logged in with this:

if ($_SESSION['username'])
{
}
else die();

Now, my problem is that after it has checked if the user is logged in, it stops executing the rest of the php on my file. I can't see my included footer at the bottom for example.

I also got this problem with getting the profile picture to show, i have set a default picture in the database that is a path (path_to_image.png).

If you want a full look of the code, check this.


Use {...}! (Lines 73-75 in your code)

else {
        echo '<div class="box_square"><div class="form_error">Du må være logget inn for å se denne siden!<br><br>Logg inn <a href="">her</a>.</div></div>';
        die ();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜