i have a profile page but i got error with session id how can i fix this problem ??? if i submit the login process the browser display the error message : Important data are missing
how to fix this error??? in the login page i did :
$sql=mysql_query( "SELECT id FROM user WHERE email_address='$email'AND password='$pass'LIMIT 1") or die("error in user table");
$login_check = mysql_num_rows($sql);
if($login_check > 0)
{
while($row = mysql_fetch_array($sql))
{
$id = $row['id'];
$_SESSION['id']= $id;
<?php
session_start();
require_once('include/connect.php');
if(isset($_GET['id']))
{
$id=$_GET['id'];
var_dump($id);
}
elseif(isset($_SESSION['id']))
{
$id= $_SESSION['id'];
}
else
{
print "Important data are missing";
//exit();
}
$sql = mysql_query("SELECT * FROM user WHERE id='$id'") or die(mysql_error());
while($row = mysql_fetch_array($sql))
{
$firstname=$row['first_name'];
$lastname=$row['last_name'];
$birth_date=$row['birth_date'];
$registered_date=$row['registered_date'];
//***************for upload img*****************//
$check_pic="members/$id/image01.jpg";
$default_pic="members/0/image01.jpg";
if(file_exists($check_pic))
{
$user_pic="<img src=\"$check_pic\"width=\"100px\"/>";
}
else
{
$user_pic="<img src=\"$default_pic\">";
}
}
?>
Your login page misses the session_start()
at the top of the script.