ABA


"מישהו יכול בבקשה להמיר לי קוד של ASP ל PHP?"
גירסת הדפסה        
קבוצות דיון בניית אתרים נושא #13817 מנהל    סגן המנהל    מפקח   Winner    צל"ש   מומחה  
אשכול מספר 13817
DiSHi
חבר מתאריך 21.4.02
1699 הודעות, דרג אמינות חבר זה
   12:59   20.04.08   
אל הפורום  
  מישהו יכול בבקשה להמיר לי קוד של ASP ל PHP?  
 
   יש לי קוד ב ASP ש lior066 התותח בנה לי..
עכשיו אני צריך את אותו הקוד.. רק ב PHP
מישהו פה יודע אולי ויכול להמיר לי אותו כדי שיעבוד ב PHP?

זה הקוד:


<%@ Page Language="VB" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Text" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

Dim Sres(0) As SearchResults
Dim Counter As Integer = 0

Public Structure SearchResults
Dim SearchResult As String
Dim PlayList As String
Dim PlayerType As String
End Structure

Public Sub Search(ByVal searchString As String)
searchString = searchString.Trim

Dim SearchLinks(6) As String
SearchLinks(0) = "http://www.dishi.co.il/idishi-va.php"
SearchLinks(1) = "http://www.dishi.co.il/idishi-yam.php"
SearchLinks(2) = "http://www.dishi.co.il/idishi-isra.php"
SearchLinks(3) = "http://www.dishi.co.il/idishi-lang.php"
SearchLinks(4) = "http://www.dishi.co.il/idishi-nos.php"
SearchLinks(5) = "http://www.dishi.co.il/idishi-yam.php"
SearchLinks(6) = "http://www.dishi.co.il/idishi-isra.php"

Dim SearchCount As Integer = 0
For SearchCount = 0 To 6
Dim req As WebRequest = WebRequest.Create(SearchLinks(SearchCount))
Dim resp As WebResponse = req.GetResponse()

Dim s As Stream = resp.GetResponseStream()
Dim sr As StreamReader = New StreamReader(s, Encoding.Default)
Dim doc As String = sr.ReadToEnd()
sr.Close()

If doc.IndexOf(searchString) > -1 Then
Dim S1() As String = {}
Dim S2() As String = {}

Select Case SearchCount
Case 0
S1 = Split(doc, "<a href=""va.php?player=")
Case 1
S1 = Split(doc, "<a href=""yamtichoni.php?d=MAlbums.php&player=")
Case 2
S1 = Split(doc, "<a href=""israeli.php?d=IAlbums.php&player=")
Case 3
S1 = Split(doc, "<a href=""lang.php?player=")
Case 4
S1 = Split(doc, "<a href=""nostalgy.php?player=")
Case 5
S1 = Split(doc, "<a href=""yamtichoni.php?d=MOsef.php&player=")
Case 6
S1 = Split(doc, "<a href=""israeli.php?d=IOsef.php&player=")

End Select

Dim i As Integer
For i = 1 To S1.GetUpperBound(0)
S2 = Split(S1(i), """>")
If S2(5).IndexOf(searchString) > -1 Then
Dim Isearch() As String
Isearch = Split(S2(5), "<br>")
Dim x As Integer = 0
For x = 0 To Isearch.GetUpperBound(0) - 1
If Isearch(x).IndexOf(searchString) > -1 Then
ReDim Preserve Sres(Counter)
Sres(Counter).PlayList = S2(0)
Sres(Counter).SearchResult = Isearch(x)
Select Case SearchCount
Case 0
Sres(Counter).PlayerType = "http://www.dishi.co.il/va.php?player="
Case 1
Sres(Counter).PlayerType = "http://www.dishi.co.il/yamtichoni.php?d=MAlbums.php&player="
Case 2
Sres(Counter).PlayerType = "http://www.dishi.co.il/israeli.php?d=IAlbums.php&player="
Case 3
Sres(Counter).PlayerType = "http://www.dishi.co.il/lang.php?player="
Case 4
Sres(Counter).PlayerType = "http://www.dishi.co.il/nostalgy.php?player="
Case 5
Sres(Counter).PlayerType = "http://www.dishi.co.il/yamtichoni.php?d=MOsef.php&player="
Case 6
Sres(Counter).PlayerType = "http://www.dishi.co.il/israeli.php?d=IOsef.php&player="
End Select
Counter += 1
End If
Next
End If
Next
End If
Next
End Sub

Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs)
If txtSearch.Text.Trim <> "" And txtSearch.Text.Length > 2 Then
Search(txtSearch.Text.Trim)

Dim i As Integer = 0
SearchR.Text = ""
If Sres(0).PlayerType Is Nothing Then
SearchR.Text = "<b>לא נמצאו תוצאות</b>"
Else
SearchR.Text = String.Format("נמצאו <b>{0}</b> תוצאות עבור מילת החיפוש ""{1}""" & "<br />", Counter, txtSearch.Text)
End If

For i = 0 To Sres.GetUpperBound(0)
Dim StrBulid As String = ""
StrBulid = String.Format("<a href=""{0}"" >{1}</a>", Sres(i).PlayerType & Sres(i).PlayList, Sres(i).SearchResult)
SearchR.Text += StrBulid & "<br />"
Next
End If
End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<style type="text/css" media="all">
body{background-color:black;}
.SearchResults{color:#fff;}
.SearchResults a{color:#fcfcfc;font-size:10pt;font-family:verdana,tahoma,helvetica;}
.SearchResults a:hover{color:#e6e6e6;}
.SearchResults a:viseted{color:#fcfcfc;}
input{margin:0; padding:0;}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<div dir="rtl"><center>
<asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
<asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="חפש" /><br />
</center><br />
<div class="SearchResults">
<asp:Literal ID="SearchR" runat="server"></asp:Literal></div>
</div>
</div>
</form>
</body>
</html>

תודה רבה לעוזרים..!


                                שתף        
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד

תגובה מהירה
___________________________________________________________________

___________________________________________________________________
למנהלים:  נעל | תייק בארכיון | מחק | העבר לפורום אחר | מחק תגובות | עגן אשכול
       



© כל הזכויות שמורות ל-רוטר.נט בע"מ rotter.net