0
我想顯示來自一個especific用戶的信息,並且我有一個$ _session 工作正常,但有一個表,在這種情況下,我不想使用 表我必須使用CSS div,當我測試它時,告訴我這個 錯誤注意:未定義索引:當這個「usuario」科莫 從登錄索引文件
<?php
require("conection/connect.php");
session_start();
$sql="SELECT stu_id,
f_name,
s_name,
l_name,
sl_name,
gender,
dob,
pob,
address,
phone,
email,
note
from tblstudents
where stu_id"; //i want to use a where stu_id='".$_SESSION['usuario']."'"; but it is not working show me Notice: Undefined index: usuario in C:\xampp\htdocs\studentskin\infostudent.php on line 2
$infostudent=mysql_query($sql); // but when I did a test with where stu_id"; it is showing me the all users that I have on the table
?>
<html>
<head><center><h3>Alumno</h3></center></head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>::. Secundaria 10 .::</title>
<link href="css/backgroundcolor.css" />
<body>
<center>
<?php
while ($tblstudents=mysql_fetch_assoc($infostudent)){
echo $tblstudents['stu_id'].
"<div>".$tblstudents['f_name']." ".$tblstudents['s_name']." ".$tblstudents['l_name']." ".$tblstudents['sl_name']."</div>";
echo"";
}
?>
//我想用$ _SESSION只是登錄我並告訴我信息我已記錄的所有信息
請問您可以發佈整個代碼嗎? –
您可以粘貼$ _SESSION定義的代碼嗎? – Jerry
if(isset($ _ POST ['btn_log'])){ \t \t $ uname = $ _ POST ['unametxt']; \t \t $ pwd = $ _ POST ['pwdtxt']; \t \t $ _SESSION ['usuario'] = $ _POST ['unametxt']; \t \t \t \t $ _SESSION ['password'] = $ _POST ['pwdtxt']; \t \t \t \t \t \t \t \t $ _SESSION [ 'usuario'] = $ _POST [ 'unametxt']; \t \t \t \t \t \t $ _SESSION ['password'] = $ _POST ['pwdtxt']; \t \t $ SQL =請求mysql_query(「SELECT * FROM tbluser \t \t \t \t \t \t \t \t其中username = '$ UNAME' 和密碼= '$ PWD' \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t「); –