Hola de nuevo,
bueno, mira, vamos al grano, te pongo el código completo de la page....
no quería llegar hasta este punto para no abusar de tí, pero al final....
Código PHP:
<%
Response.Buffer = True
redim path(4)
path(1)= server.mappath("../my_life") 'en donde se hará la busqueda
path(2) = server.mappath("../aficiones") 'en donde se hara la busqueda
path(3) = server.mappath("../biografia") 'en donde se hara la busqueda
path(4) = server.mappath("../comentarios") ' en donde se hará la busqueda
Exts = "htm,html,asp" 'extensiones de los archivos sobre los que se hará la busqueda
clave = Request.Form("clave") 'clave a buscar
Redim Resultados(1000,1) 'se podrán registrar hasta 1000 posibles resultados
Session("Encontrados") = 0
Session("Totales") = 0
Inicio = Now()
resx = 0
for x= 1 to 4
%>
<style>
A:link {text-decoration: none;}A:visited {text-decoration: none;}
</style>
<%
Call Buscar(Path(x),Exts,clave) 'empieza la busqueda
next
cuantos = Session("encontrados")
call DualSorter(cuantos) 'se ordena o se 'rankean' los resultados
call Crear_Archivo_resultados
If cuantos>0 then
tomaron = datediff("s",Inicio,Now())
Response.Redirect "mostrar.asp?clave=" & clave & "&Tomaron=" & Tomaron & "&Totales=" & Session("Totales")& "&Inicio=1"
Else
Response.Write "<center><Font face='arial,verdana,helvetica' size='2'>"
Response.Write "<b>http://" & Request.ServerVariables("HTTP_HOST") & "</b><br><hr size='2'>"
Response.Write "No se encontrarón archivos que contengan la palabra clave:<b> " & clave & "</b><br>"
Response.Write "<a href='Default.asp'> >> Pulsa aquí para realizar otro busqueda <<</a></center></font>"
End if
%>
<%
Function Buscar(PathSpec,Exts,clave)
If right(PathSpec,8)<>"_vti_cnf" then
Set Fso = CreateObject("Scripting.FileSystemObject")
Set FolderInfo = Fso.GetFolder(PathSpec)
Set FileList = FolderInfo.Files
'resx = 0
For Each File in FileList 'obtener todo el listado de archivo de dir actual
Session("Totales") = Session("Totales") + 1
FileName = UCase(Cstr(File.Name))
If InStr(1, Exts, fso.GetExtensionName(file.Name), vbTextCompare) > 0 Then
page = contenido(PathSpec & "/" & FileName) 'solo una vez se accesa el archivo
Session("Coincidencias")= 0
If buscar_todo(page,clave) then
Session("Encontrados") = Session("Encontrados") + 1
Resultados(resx,0) = "<font size='2'><A HREF=""" & FormatURL(PathSpec) & "/" & FileName & """>"
Resultados(resx,0) = Resultados(resx,0) & Titulo(page) & "<a/></font><br>"
metas = obtener_metas(page) ' obtener todos los meta tags de la página
If len(metas)>0 then
j2 = Split(metas,"|",-1,1)
k = 1
Metas = Ubound(j2)
For m=0 to Ubound(j2)
Resultados(resx,0) = Resultados(resx,0) & j2(m)
k = k + 1
Next
End if
if File.Size < 1024 Then
tam = File.Size & " Bytes"
ElseIf File.Size < 1048576 Then
tam = Round(FileSizeTotal/1024, 2) & " KB"
Else
tam = Round((FileSizeTotal/1024)/1024.1, 2) & " MB"
End if
Resultados(resx,0) = Resultados(resx,0) & tam & " Archivo creado el: " & File.DateCreated & " Ultima modificación: " & File.DateLastModified & "<br>"
Resultados(resx,1) = Session("Coincidencias")
resx = resx + 1
End if
End if
Next
Set f = Fso.GetFolder(PathSpec)
Set fc = f.SubFolders
For Each Folder in fc 'recursividad dentro de los directorios
Call Buscar(PathSpec & "\" & Folder.Name,Exts,clave)
Next
End if
End Function
%>
<%
Sub Crear_Archivo_resultados
set fso = Server.CreateObject("scripting.FileSystemObject")
Arch_temp = Server.MapPath(Session.SessionId & ".txt")
set File = fso.CreateTextFile(Arch_temp, true,false)
For k=0 to Session("Encontrados")-1
File.WriteLine(Resultados(k,0))
File.WriteLine(Resultados(k,1))
Next
File.Close
Set file = nothing
Set fso = nothing
End sub
%>
<%
Function Contenido(page) 'obtengo el contenido del archivo y lo pongo en una variable
Set objFSO2 = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO2.OpenTextFile(page)
strContents = objFile.ReadAll
objFile.Close
Set objFile = Nothing
Set objFSO2 = Nothing
Contenido = strContents
End Function
%>
ahí está, yo obstante, estoy intentando encontrar un backup antiguo de esta pagina, para ver si he realizado algún cambio sin darme cuenta en las últimas fechas....
nos vemos pronto