[align=left]
keyword = Request("keywordtext")
if keyword<>"" then
sts = Split(keyword," ")
DO WHILE NOT ObjectRecordSet.EOF
k = TRIM(ObjectRecordSet("فيلدي كه ميخواهد بر روي آن جستجو انجام شود"))
sns = Split(k , " " )
for l = 0 to UBound(sns)
for n = 0 to UBound(sts)
if sts(n) = sns(l) then
sres = sres + 1
Response.write ("اطلاعات مورد نظر شما")
n = UBound(sts)
l = UBound(sns)
srf = 1
end if
next
next
ObjectRecordSet.MoveNext
LOOP
end if
[/align]
<html>
<head>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
</head>
</html>
<%
dim objrs2
DIM objconn2
set objconn2=server.createobject("ADODB.connection")
objconn2.connectionstring="DRIVER={Microsoft Access Driver (*.mdb)};"&_
"dbq=" & Server.MapPath("book.mdb")
objconn2.open
set objrs2=server.createobject ("ADODB.Recordset")
objrs2.open "main",objconn2, , , 2
keyword = "نیما"
if keyword<>"" then
sts = Split(keyword," ")
DO WHILE NOT objrs2.EOF
k = TRIM(objrs2("motarjem"))
sns = Split(k , " " )
for l = 0 to UBound(sns)
for n = 0 to UBound(sts)
if sts(n) = sns(l) then
sres = sres + 1
Response.write ("اطلاعات مورد نظر شما")
n = UBound(sts)
l = UBound(sns)
srf = 1
end if
next
next
objrs2.MoveNext
LOOP
end if
objrs2.close
set objrs2=nothing
objconn2.close
set objconn2=nothing
%>
<html dir=rtl >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title>FARSI SEARCH</title>
</head>
<body>
<FORM name="F1" method=post action="FARSI_SEARCH.ASP">
<label for "T1">عبارت مورد نظر :</label>
<input type=text name="T1" dir=rtl maxlength=50>
<input type=submit value="جستجو">
<%
IF LEN(REQUEST.FORM("T1"))>0 THEN
DATABASE_PATH = "databases\CLINIC_DATA.mdb"
TABLE_NAME = "TARIFF"
FIELD_NAME = "SERVICE"
DIM CONN
SET CONN = Server.CreateObject("ADODB.Connection")
CONN.OPEN ("Driver={Microsoft Access Driver (*.mdb)};Dbq=" & SERVER.MAPPATH(DATABASE_PATH))
DIM RS
SET RS = Server.CreateObject("ADODB.Recordset")
SQLQ = "SELECT " & FIELD_NAME & " FROM " & TABLE_NAME & " WHERE " & FIELD_NAME & " LIKE '%" & FX(REQUEST.FORM("T1")) & "%'"
RS.OPEN SQLQ, CONN
%>
<table>
<%
DO WHILE NOT RS.EOF
X = UNI(RS("SERVICE"))
%>
<tr>
<td><%=X%></td>
</tr>
<%
RS.MOVENEXT
LOOP
%>
</table>
<%
RS.CLOSE
SET RS = NOTHING
CONN.CLOSE
SET CONN = NOTHING
END IF
FUNCTION UNI(X)
Z=""
FOR I=1 TO LEN(X)
Z = Z & "&#" & ASCW(MID(X,I,1)) & ";"
NEXT
UNI=Z
END FUNCTION
FUNCTION FX(X)
Z=""
DIM RX, MTC, MTCS
SET RX = NEW REGEXP
RX.PATTERN = "&#....;"
DO WHILE RX.TEST(X)
SET MTCS = RX.EXECUTE(X)
FOR EACH MTC IN MTCS
Y = MID(MTC.VALUE,3,4)
' IF Y=1740 THEN Y=1610 'yeh
' IF Y=1705 THEN Y=1603 'kaf
Z = Z & LEFT(X,MTC.FIRSTINDEX) & CHRW(Y)
X = RIGHT(X,LEN(X)-7)
EXIT FOR
NEXT
LOOP
FX = TRIM(Z & X)
END FUNCTION
%>
</FORM>
</body>
</html>