Current location: Hot Scripts Forums » Programming Languages » PHP » ASP to PHP convert help!


ASP to PHP convert help!

Reply
  #1 (permalink)  
Old 08-15-04, 06:48 AM
fantaziachat fantaziachat is offline
Newbie Coder
 
Join Date: Aug 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Question ASP to PHP convert help!

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%>&nbsp; Max: <%=Application("Serv").LocalMaxCount%><br>
Current global users: <%=Application("Serv").GlobalCount%>&nbsp; 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&nbsp;&nbsp;&nbsp;&nbsp;
      <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">&nbsp; </td>
    </tr>
    <tr>
      <td width="11%">
      Password:</td>
      <td width="89%">
      <input type="text" name="REGPW" size="29"></td>
    </tr>
    <tr>
      <td width="11%">
      &nbsp;</td>
      <td width="89%">
      <input type="radio" value="1" checked name="ACTION">Register&nbsp;&nbsp;&nbsp;&nbsp;
      <input type="radio" name="ACTION" value="0"> Unregister</td>
    </tr>
    <tr>
      <td width="11%">
      &nbsp;</td>
      <td width="89%">
      <input type="submit" value="Submit"></td>
    </tr>
  </table>
</form>
<p>&nbsp;</p>
<%End If%></html>
thanks for reading my post I hope you can help me
Reply With Quote
  #2 (permalink)  
Old 08-15-04, 08:58 AM
kvnband kvnband is offline
Wannabe Coder
 
Join Date: Jun 2003
Posts: 242
Thanks: 0
Thanked 0 Times in 0 Posts
If I knew ASP, then I'd help ya.....but there are lots of readly made PHP chat scriupts. why not use on e of them?
Reply With Quote
  #3 (permalink)  
Old 08-15-04, 09:02 AM
fantaziachat fantaziachat is offline
Newbie Coder
 
Join Date: Aug 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
hi

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
Reply With Quote
  #4 (permalink)  
Old 08-15-04, 10:17 AM
kvnband kvnband is offline
Wannabe Coder
 
Join Date: Jun 2003
Posts: 242
Thanks: 0
Thanked 0 Times in 0 Posts
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)

Sorry man
Reply With Quote
  #5 (permalink)  
Old 08-15-04, 12:34 PM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Is this the whole code? what's Application?
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png
Reply With Quote
  #6 (permalink)  
Old 08-15-04, 12:41 PM
fantaziachat fantaziachat is offline
Newbie Coder
 
Join Date: Aug 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
yep

yes that is to files Register.asp and chatserver.asp there are full code and it is for my ircxpro irc server www.ircxpro.com
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Whats best asp or php ? BoGuS PHP 4 07-16-04 01:22 PM
Translate ASP to PHP and PERL POSERA ASP 0 06-12-04 01:12 AM
PHP integrated with ASP Mikeirv PHP 7 05-25-04 05:00 AM
convert perl code to php phptalk Perl 1 01-15-04 02:06 AM
How to convert php generated pages to SE friendly HTML or PHP(SE friendly) -CLASS 101 crippled PHP 1 11-16-03 06:37 AM


All times are GMT -5. The time now is 04:19 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.