
30-01-2012, 15:50:04
|
| |
session kullanımı hakkında | | arkadaşlar bu kodda listeme ve sayfalama yaptırmak istiyorum kodlarım çalışıyor yalnız 2. sayfaya geçmek istediğimde sayfa boş bunun sebebide post yöntemi kullandığım için bunun session ile düzeltebileceğimi söylediler ama ben yapamadım yardımcı olabilirmsiiniz. Kod: <form action="?SNO=<%=Request.QueryString("SNO")%>" method="post">
<select size="1" name="kull" style="font-family: Calibri; font-size: 10pt; font-weight: bold">
<option value="Boş"></option>
<option>Elektrik İşletme</option>
<option>Kazan İşletme</option>
<option>Türbin İşletme</option>
<option>Su Hazırlama</option>
<option>A4</option>
<option>F5</option>
<option>BGA İşletme</option>
<option>Dış Tesisler İşletme</option>
</select>
<input type="submit" value="Gönder" />
</form>
<%
intPage = Request.QueryString("SNO")
If intPage = "" OR not IsNumeric(intPage) Then
intPage = Int(1)
Else
intPage = Int(intPage)
End If
%>
<table width="100%" colspan="2" cellspacing="5" cellpadding="5">
<tr>
<td aligin="left" bgcolor="#404040" width="3%" height="35"><font face="arial" size="2" color="#FFFFFF"><b>no</b></font></td>
<td aligin="left" bgcolor="#404040" width="12%" height="35"><font face="arial" size="2" color="#FFFFFF"><b>SERVİS</b></font></td>
<td aligin="left" bgcolor="#404040" width="83%" height="35"><font face="arial" size="2" color="#FFFFFF"><b>ARIZA</b></font></td>
</tr>
<%
Set Baglanti = Server.CreateObject("aDodb.connection")
Baglanti.Open "Driver=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("../db/db.mdb")
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
strKull=Request.Form("kull")
Set objRs = Baglanti.Execute("SELECT COUNT(*) AS records FROM dal WHERE web = '" & strKull & "';")
intRecords = Trim(objRs("records"))
objRs.Close
Set objRs = Nothing
intPageSize = 14 'bir sayfada gösterilecek miktar.
intStart = intPage*intPageSize
intStart = intStart-intPageSize
intPages = intRecords/intPageSize + 1
Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.Open"SELECT * FROM dal WHERE web = '" & strKull & "' order by id desc ", Baglanti, 1, 3
IF Rs.EOF OR Rs.BOF THEN
'Eğer Kayıt yoksa hata mesajı yazabiliRsin
ELSE
FOR i = 1 TO intPageSize
IF Rs.EOF THEN EXIT FOR
%>
<tr>
<td aligin="left" bgcolor="#FFFFFF" width="3%" height="35"><font face="arial" size="2" color="#000000"><%=i + (SNO + 1) * 0%> </font></td>
<td aligin="left" bgcolor="#FFFFFF" width="3%" height="35"><font face="arial" size="2" color="#000000"><%=strKull%> </font></td>
<td aligin="left" bgcolor="#FFFFFF" width="12%" height="35"><font face="arial" size="2" color="#000000"><%=RS("NOT")%></font></td>
</tr>
<%
Rs.MoveNext
Next
Response.Write "Sayfalar : " & VBCrlf
For P = 1 To intPages
If P = intPage Then
Response.Write P & " "
ELSE
Response.Write "<a href=""isteyen_servise_gore.asp?SNO=" & P & """>" & P & "</a>" & VBCrlf
END IF
NEXT
Rs.Close
End If
end if
%>
</table> |