I am learning php. I created a registration and login system. It works fine. But I'm curious about something: how can i display user details in user profile. For example name, surname, email etc. My login system IS functional but displays only email.
This is my profile.php code.
<?php
session_start();
if (!isset($_SESSION['email'])) {
header('location: index2.php');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<link href="css/profile.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<div class="header_in">
<div class="logo"><span>EcoWebTr</span></div>
<div class="cik"><a href="cikis.php">Çıkış</a></div>
<!--Login informtion--></div>
</div>
<div class="container">
<div class="wrapper">
User Email:
<font color="#000066"><?php echo $_SESSION['email']; ?></font>
</div>
</div>
</body>
</html>
And also this is login.php
<?php
include("includes/connect.php");
if(isset($_POST['login'])) {
$email = $_POST['email'];
$password = md5($_POST['password']);
$check_user = "SELECT * FROM users WHERE email='$email' AND password='$password'";
$run = mysql_query($check_user);
if(mysql_num_rows($run)>0) {
$_SESSION['email']=$email;
echo"<script>window.open('profile.php','_self')</script>";
} else {
echo"<script>alert('wrong email or password')</script>";
}
}
?>