Jump to content
php.lv forumi

login sesijas


ziedinjsh

Recommended Posts

Man ir šādi:

 

iekš logina (ja viss ir pareizi)

session_start();
session_register("email"); 
header("location:../index.php");

 

un lai atpazītu ka ir ielogojies

session_start();
if($_SESSION['email']){
echo "esmu iekšā";
}else{
echo "neesmu";
}

 

it kā viss strādā, bet vai tā būtu pareizi!?

Link to comment
Share on other sites

Sesijā nekas nav jāreģistrē!

 

Tur vari tur saglabāt kaut ko, mierīgi...

 

$_SESSION['user_id'] = 33;

 

Pēc tam... kāpēc gan nē?

 

$username = get_username_from_id($_SESSION['user_id']);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...