Hello, I am new to programming. All evening I can not solve the problem. In the login.php file there is the following code (it works on entry, it works with the table: username, password, login):
<?php error_reporting(E_ALL & ~E_DEPRECATED); $connect=mysql_connect('localhost', 'root', '') or die (mysql_error()); mysql_select_db('rash'); if (isset($_POST['enter'])) { $e_login=$_POST['e_login']; $e_password=$_POST['e_password']; $query=mysql_query("SELECT * FROM WIreg WHERE login='$e_login'"); $user_data=mysql_fetch_array($query); if ($user_data['password']==$e_password) { $re=mysql_query("SELECT * FROM WIreg WHERE 'login'='$user'"); $name=mysql_fetch_array($re); setcookie('cookie_name', $name['username']); $_SESSION['cookie_name'] = $name['username']; header("location: user/auth.html"); } else { echo "wrong password or login"; } } ?> Displays the entire auth.html page except the name username. Further in the auth.html file (located in the user directory) there is the following code:
<? session_start(); echo $_SESSION['cookie_name']; ?> Question: why the username is not displayed?
<?php, but through<?) - Alexey Shimansky