Hello all I am wondering if anyone can help me out I looking for a php version of the 2 following codes :
chatserver.asp file :
Code:
<%
On Error Resume Next
CreateLink
Function CreateLink()
If Not IsObject(Application("Info")) Then
Set Application("Info") = Server.CreateObject("IRCXpro.Information")
' ServerName, ChatPort, Account, Password
Application("Info").LogonSettings "192.168.2.103", 6667, "admin", "eden" ' This information will need to be changed
End If
If Not IsObject(Application("Serv")) Then
Set Application("Serv") = Server.CreateObject("IRCXpro.Services")
' ServerName, RemotePort, Account, Password
Application("Serv").LogonSettings "192.168.2.103", 7100, "admin", "eden" ' This information will need to be changed
End If
End Function
Function ChannelsInFrame()
Dim Data
Dim LineData
Data = Application("Info").ColorToText(Application("Info").Channels)
ChannelsInFrame = "<table border=1><tr><td><b>Channel Name</b></td><td><b>Members</b></td><td><b>Topic</b></td></tr>"
Do Until InStr(1, Data, Chr(10), 0) = 0
LineData = Mid(Data, 1, InStr(1, Data, Chr(10), 0) - 1)
If Mid(LineData, Len(LineData), 1) = Chr(13) Then LineData = Mid(LineData, 1, Len(LineData) - 1)
Data = Mid(Data, InStr(1, Data, Chr(10), 0) + 1, Len(Data))
ChannelsInFrame = ChannelsInFrame & "<tr><td>" & Application("Info").MsgBreak(CStr(LineData), 1) & "</td><td>" & Application("Info").MsgBreak(CStr(LineData), 2) & "</td><td>" & Application("Info").MsgBreak(CStr(LineData), 3, True) & "</td></tr>"
Loop
ChannelsInFrame = ChannelsInFrame & "</table>"
End Function
Function NicknamesInFrame()
Dim Data
Dim LineData
Data = Application("Info").ColorToText(Application("Info").UsersInChannels)
NicknamesInFrame = "<table border=1><tr><td><b>Nickname</b></td><td><b>Real Name</b></td><td><b>Channel</b></td></tr>"
Do Until InStr(1, Data, Chr(10), 0) = 0
LineData = Mid(Data, 1, InStr(1, Data, Chr(10), 0) - 1)
If Mid(LineData, Len(LineData), 1) = Chr(13) Then LineData = Mid(LineData, 1, Len(LineData) - 1)
Data = Mid(Data, InStr(1, Data, Chr(10), 0) + 1, Len(Data))
NicknamesInFrame = NicknamesInFrame & "<tr><td>" & Application("Info").MsgBreak(CStr(LineData), 1) & "</td><td>" & Application("Info").MsgBreak(CStr(LineData), 3, True) & "</td><td>" & Application("Info").MsgBreak(CStr(LineData), 2) & "</td></tr>"
Loop
NicknamesInFrame = NicknamesInFrame & "</table>"
End Function%>
<html>
<title><%=Application("Info").ServerName%></title>
<P>There are <%=Application("Serv").VisibleCount%> users and <%=Application("Serv").InvisibleCount%> invisible on <%=Application("Serv").GlobalServersCount%> servers<br>
<%=Application("Serv").OperatorsCount%> operator(s) online<br>
<%=Application("Serv").UnknownCount%> unknown connection(s)<br>
<%=Application("Serv").ChannelsCount%> channels formed<br>
I have <%=Application("Serv").LocalCount%> clients and <%=Application("Serv").LocalServersCount%> servers<br><br>
Current local users: <%=Application("Serv").LocalCount%> Max: <%=Application("Serv").LocalMaxCount%><br>
Current global users: <%=Application("Serv").GlobalCount%> Max: <%=Application("Serv").GlobalMaxCount%></p><br>
<p>Message of the day</p>
<p><%=Application("Info").ReplaceCRLF(Application("Info").ColorToText(Application("Info").MOTD))%></p><br>
<p><%=ChannelsInFrame%></p><br>
<p><%=NicknamesInFrame%></p>
</html>
Register.asp file :
Code:
<%
On Error Resume Next
CreateLink
Function CreateLink()
If Not IsObject(Application("Serv")) Then
Set Application("Serv") = Server.CreateObject("IRCXpro.Services")
' ServerName, RemotePort, Account, Password
Application("Serv").LogonSettings "LocalHost", 7100, "admin", "password" ' This information will need to be changed
End If
End Function%>
<html>
<title>Register your channel or nickname</title>
<%if Request.ServerVariables("request_method")="POST" then
Dim rPW
Select Case Request.Form("REGTYPE")
Case 0 ' Channel
Select Case Request.Form("ACTION")
Case 0 ' Unregister Channel
rPW = Application("Serv").GetChannelPassword(Request.Form("REGNAME"))
If rPW = "" Then%>
Channel not registered
<%ElseIf rPW = Request.Form("REGPW") Then
Application("Serv").UnregisterChannel Request.Form("REGNAME")%>
Channel now unregistered
<%Else%>
Channel password mismatch
<%End If
Case 1 ' Register Channel
If Application("Serv").RegisterChannel(Request.Form("REGNAME"), Request.Form("REGPW")) Then%>
Channel registration successful
<%Else%>
Channel registration failed
<%End If
End Select
Case 1 ' Nickname
Select Case Request.Form("ACTION")
Case 0 ' Unregister Nickname
rPW = Application("Serv").GetNicknamePassword(Request.Form("REGNAME"))
If rPW = "" Then%>
Nickname not registered
<%ElseIf rPW = Request.Form("REGPW") Then
Application("Serv").UnregisterNickname Request.Form("REGNAME")%>
Nickname now unregistered
<%Else%>
Nickname password mismatch
<%End If
Case 1 ' Register Nickname
If Application("Serv").RegisterNickname(Request.Form("REGNAME"), Request.Form("REGPW")) Then%>
Nickname registration successful
<%Else%>
Nickname registration failed
<%End If
End Select
End Select
Else%>
<form method="POST" action="">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber4">
<tr>
<td width="11%">
Registration:</td>
<td width="89%">
<input type="radio" value="0" checked name="REGTYPE">Channel
<input type="radio" name="REGTYPE" value="1"> Nickname</td>
</tr>
<tr>
<td width="1%">Name:</td>
<td width="185%"><input type="text" name="REGNAME" size="29"> </td>
</tr>
<tr>
<td width="11%">
Password:</td>
<td width="89%">
<input type="text" name="REGPW" size="29"></td>
</tr>
<tr>
<td width="11%">
</td>
<td width="89%">
<input type="radio" value="1" checked name="ACTION">Register
<input type="radio" name="ACTION" value="0"> Unregister</td>
</tr>
<tr>
<td width="11%">
</td>
<td width="89%">
<input type="submit" value="Submit"></td>
</tr>
</table>
</form>
<p> </p>
<%End If%></html>
its not a chat script its a script that shows connected users on my chat server and its a register script there no php version and I dont use asp I need help on it bad
OK. Well, I've tried 2 asp to php converters, and neither of them works quite right. (asp2php totally doesn't do it, and a web based one might work, but it's got javascript errors, so it doesn't)