
12/09/2002, 11:40
|
 | | | Fecha de Ingreso: abril-2002 Ubicación: Málaga
Mensajes: 1.475
Antigüedad: 23 años, 1 mes Puntos: 9 | |
Re: Buscador Asp De Victor Garay.(no Bd) y ya por último MOSTRAR.ASP
<%
Session("Inicio") = Request.QueryString("Inicio") 'para paginar
Session("Clave") = Request.QueryString("Clave")
cuantos = 5 'cuantos 'links' se mostrarán por página
Response.Write "<Font face='verdana,arial,helvetica' size='1'>"
Response.Write "Resultado de la busqueda de la clave: "
Response.Write "<b>" & Session("clave") & "</b> en el sitio: " & "<b>http://" & Request.ServerVariables("HTTP_HOST") & "</b><br><hr size='1'>"
Call Mostrar_resultados(empieza,cuantos,session("T otales"))
Finalizo = Now()
'Response.Write "<br>Mostrando " & cuantos & " de " & Session("Encontrados") & " resultados disponibles."
response.write "<br> mostrando "
if session ("encontrados")<cuantos THEN
response.write(session("encontrados"))
else
if session("encontrados")-session("inicio")<cuantos THEN
response.write(session("encontrados")-session("inicio")+1)
ELSE
response.write(cuantos)
end if
end if
response.write(" de " & Session("Encontrados") & " resultados disponibles.")
Response.Write "<br>" & now
Response.Write "</font>"
Response.Write "<center><Font face='verdana,arial,helvetica' size='1'>"
Response.Write "<a href='default.asp'> >> Realiza otra busqueda <<</a></center></font>"
%>
<%
Sub mostrar_resultados(empieza,cuantos,totales)
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObje ct")
Dim objTextStream
strFileName = Server.MapPath(Session.SessionId & ".txt")
If objFSO.FileExists(strFileName) then
Set objTextStream = objFSO.OpenTextFile(strFileName, 1)
If Cint(Session("Inicio"))<=0 then
Limites = 0
Else
Limites = Cint(Session("Inicio"))-1
End if
For saltos=1 to limites 'saltar lineas dependiendo que 'pagina' se muestra
objTextStream.SkipLine
objTextStream.SkipLine
Next
For rows=Cint(Session("Inicio")) to Cint(Session("Inicio")) + cuantos -1
If (rows=< Cint(Session("encontrados")) or rows>0) and rows<=Cint(Session("Encontrados")) then
Linea1 = objTextStream.ReadLine
Linea2 = objTextStream.ReadLine
Response.Write "(" & rows & " de " & Session("Encontrados") & ".-) "
Response.Write Linea1
Response.Write "Se encontrarón <b><Font color='GREEN'>" & Linea2 & "</font>"
Response.Write "</b> ocurrencias de la clave en esta página."
Response.Write "<br><hr align='left' width='75%' size='1' color='#FFB650'><br>"
Else
Exit For
End if
Next
objTextStream.Close
Set objTextStream = Nothing
Else
Response.Write "No se obtuvieron resultados para tu busqueda, es necesario que hagas <a href='default.asp'>otra busqueda.</a>"
End If
Set objFSO = Nothing
Response.Write "<center>"
'controles << >>
Response.write "<div align='center'>"
Response.write "<center>"
Response.write " <table border='0' cellpadding='0' cellspacing='0' width='50%'>"
Response.write " <tr>"
Response.write " <td width='50%'>"
If Limites> 0 then
%>
<style>
<!--//A:link {text-decoration: none;}A:visited {text-decoration: none;}//-->
</style>
<img border="0" src="../images/M9.gif">
<%
Response.Write "<a href='Mostrar.asp?inicio="& rows-(cuantos*2) &"&clave=" & Session("Clave") &"'> Página anterior </a>"
End if
Response.write "</td>"
Response.write " <td width='50%'>"
If rows < Cint(Session("Encontrados")) then
%>
<style>
<!--//A:link {text-decoration: none;}A:visited {text-decoration: none;}//-->
</style>
<img border="0" src="../images/M3.gif">
<br>
<%
Response.Write "<a href='Mostrar.asp?inicio="& rows &"&clave=" & Session("Clave") &"'> Más resultados </a>"
End if
Response.write "</td>"
Response.write " </tr>"
Response.write " </table>"
Response.write " </center>"
Response.write "</div>"
Response.Write "</center>"
End sub
%>
HALA AQUI ESTA TODO, A VER QUIEN CONTRIBUYE AHORA A ESTE PROYECTO Y CREA EL SCRIPT PARA EVITAR
LA BUSQUEDA DENTRO DEL CODIGO FUENTE.
Salu2
ByE
<html>
<body>
<p align="left"><font color="#FF0000" face="Comic Sans MS" size="2">Aprendiz
de todo y maestro de nada[/CODE]</p>
</body>
</html> |