我有一个个人资料页面,但我的会话 ID 出现错误我该如何解决这个问题???如果我提交登录过程,浏览器会显示错误消息:缺少重要数据
如何解决这个错误???在登录页面中我做了:
$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\">";
}
}
?>