<?php function LogInUser($nick,$pswrd){ $Query = "SELECT * FROM USERS WHERE nick ='".$nick."'"; $id = $row['id']; $pass = $row['password']; $rankid = $row['rankid'];} if($pswrd == $pass){ $QueryRank = "SELECT * FROM USERS_RANK WHERE id ='".$rankid."'"; $name = $row['name']; $articles = $row['articles']; $articles_category = $row['articles_category']; $modules = $row['modules']; $users = $row['users']; $users_rank = $row['users_rank']; $forum = $row['forum']; $headers = $row['headers']; $config = $row['config'];} //SESJE DO AUTORYZACJI $_SESSION['userid'] = $id; $_SESSION['userip'] = $_SERVER['REMOTE_ADDR']; $_SESSION['rankname'] = $name; $_SESSION['articles'] = $articles; $_SESSION['articles_category'] = $articles_category; $_SESSION['modules'] = $modules; $_SESSION['users'] = $users; $_SESSION['users_rank'] = $users_rank; $_SESSION['forum'] = $forum; $_SESSION['headers'] = $headers; $_SESSION['config'] = $config; //KONIEC LISTY SESJI if($CONFIG_Logging = "1"){ AddLog("Do serwisu zalogował się ".$nick); } } else{ $Msg = "Logowanie niepowiodło się!"; } }; ?>
1.php
<?php include ('users.inc.php'); LogInUser('maciek','blabla'); ?>
2.php
<?php } else{ } ?>