Do not display the name of the unit, what to do? The user has his own unit, this unit is found in the table with the password and login, how to pull it out from there?
User page:
<?php session_start(); echo "Добро пожаловать, ".$_SESSION['username']."!"; echo "Твой Бакуган, ".$_SESSION['bakugan']."!"; ?> And login verification:
<?php session_start(); $host = ""; $username = ""; $password = ""; $db_name = ""; $tbl_name = ""; mysql_connect($host, $username, $password) or die("can't connect"); mysql_select_db($db_name) or die(mysql_error()); $username = $_POST['username']; $password = $_POST['password']; $sql = "SELECT `username`,`bakugan` FROM $tbl_name WHERE username='$username' and password='$password'"; $result = mysql_query($sql); $count = mysql_num_rows($result); if($count==1) { session_register("username"); session_register("password"); header("location:login_success.php"); $_SESSION['username'] = $username; $_SESSION['bakugan'] = $bakugan; } else{ echo "Неверный логин или Пароль"; } PS knes, sorry the last stupid question)))