|
|
|
ต้องการส่งค่าหน้า login หากเราต้องการส่งค่า ที่ผู้ใช้ login เข้ามา แล้วใช้ค่าดังกล่าวตรวจสอบกับฐานข้อมูลเพื่อ |
|
|
|
|
|
|
|
ผมอยากช่วยนะครับ แต่ก็ไม่อยากมานั่งไล่ code เหมือนกันครับ ถ้าถามเป็นจุด ๆ ว่าปัญหาตอนนี้มันคืออะไร
พอจะช่วยได้บ้างครับ
|
|
|
|
|
Date :
23 มิ.ย. 2548 16:57:27 |
By :
@W_IN |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มันไม่มี Error แต่ว่า ตารางที่สร้าง ไม่ยอมแสดง อยากทราบว่า เขียนผิดไวยกรณ์ หรือว่า เชื่อมฐานขอมูลผิดกันแน่ แต่ลองเอา Code เชื่อมฐานข้อมูล Run ก็ยังแสดงได้นะ เลย งง ๆ
|
|
|
|
|
Date :
23 มิ.ย. 2548 17:22:57 |
By :
siriukan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<%@ codepage="874" %>
<% user=Request.Form("user")
' ถ้า session มีการ expire จะบังคับให้ไปหน้า login ก่อน
struser=user
struser=Session("user")
If Session("user") = "" Then
Response.Redirect "default.asp"
Else%>
<!--#include file="dbconnect.asp" -->
<html>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="24%">
<!--#include file="include/backmenu.asp" -->
</td>
<td width="76%" valign="top">
หน้าการจัดการพนักงาน
<br>
<%
Dim rs, sql, counter
If ConnectDB() = True Then
sql ="SELECT CT_TbUser.Title, CT_TbUser.FirstName, CT_TbUser.LastName, CT_TbUser.[Position],CT_TbUser.Department FROM CT_TbUser INNER JOIN PI_TbOrganize ON CT_TbUser.IDNo = PI_TbOrganize.IDNo WHERE Where IDNo='"&user& "'"
On Error Resume Next
Set rs = Conn.Execute(sql)
'response.write"sql="&(sql)&"<br>" ตรวจสอบค่าที่ได้จากฐานข้อมูล
If rs.RecordCount = 0 Then
Response.Write "ไม่พบข้อมูลพนักงาน"
Else
counter=1
%>
<% Do While Not rs.EOF
Response.write "counter"
%>
<table border="1" bordercolor="#000000">
<tr bgcolor="#FFCCCC">
<td>IDNo</td>
<td>Title</td>
<td>Name</td>
<td>Lastname</td>
<td>Position</td>
</tr>
<tr>
<td><%=rs("IDNo")%></td>
<td><%=rs("Title")%></td>
<td><%=rs("FirstName")%></td>
<td><%=rs("LastName")%></td>
<td><%=rs("[Position]")%></td>
</tr>
<%
counter=counter+1
rs.MoveNext
Loop
rs.Close
Conn.close
End If
End If
%>
</table>
</body>
</html>
ประมาณนี้ มั้งครับ คือแก้ให้ช่วงต้นนะครับผมคิดว่าที่มันไม่โชวตารางให้นะเพราะว่า ค่าที่ส่งมานั้นยังไม่ได้ทำการรับ
แล้วนำมาเช็คก่อนนะครับ ลองดูเอานะครับ ผิดพลาดอย่างไรก็อภัยให้ด้วยนะครับ เพิ่งหัดเขียนนะครับ
|
|
|
|
|
Date :
23 มิ.ย. 2548 18:47:39 |
By :
พามา |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<form action="LOGOK.ASP" method="post">
<center><table border="0" WIDTH =30% >
<tr>
<td><font face="cordiaUPC" color=yellow size=5><strong>UserName: </strong></font></td><td><input type="text" size="15" name="username"></td>
</tr>
<tr>
<td><font face="cordiaUPC" color=yellow size=5><strong>PassWord:</strong></font></td><td><input type="password" size="15" name="Password"></td>
</tr>
</table>
<br>
<table>
<tr>
<td><input type="submit" name="BtnLogin" value=" Logon " onclick="CMDLOGIN()"></td><td><input type="reset" name="BtnClear" value=" Reset "></td>
</tr>
</table>
</form>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
ต้องเอา คำสั่งที่ว่า แทรกส่วนไหนบ้างหรอค่ะ
|
|
|
|
|
Date :
17 ม.ค. 2550 10:56:15 |
By :
A |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|