我有一個登錄腳本顯示,與字段的表,這裏需要的一個是「阿凡達」(VARCHAR(255)& defaul項是一個圖像鏈接)鏈接無法從DB
代碼查看個人資料:
<div align="center"><img src="<?php echo $_GET['avatar']; ?>" width="250" height="250" /></div>
代碼會話:
function set_session($username, $password) {
$query = $this->query("SELECT * FROM ".DBTBLE." WHERE username='$username' AND password='$password'");
ini_set("session.gc_maxlifetime", Session_Lifetime);
session_start();
$_SESSION['first_name'] = $query['result']['first_name'];
$_SESSION['last_name'] = $query['result']['last_name'];
$_SESSION['email_address'] = $query['result']['email_address'];
$_SESSION['username'] = $query['result']['username'];
$_SESSION['info'] = $query['result']['info'];
$_SESSION['user_level'] = $query['result']['user_level'];
$_SESSION['password'] = $query['result']['password'];
$_SESSION['avatar'] = $query['result']['avatar'];
}
有添加頭像沒有特色,所以我在表單中添加的節目<div>
功能,創建一個科拉姆n在名爲頭像的數據庫中,並添加了$_SESSION['avatar'] = $query['result']['avatar']
,但默認圖像不顯示,我哪裏出錯了?除了頭像之外,全部都已經顯示。
避免保存在sessison密碼.. – Dinesh 2013-05-12 10:46:16