Heres a cheap chatter source
1st open up notepad and put this code
PHP Code:
<form action="conversation.php" method="post">
<center>
Username: <br><input type="text" name="user" /> <br>
Enter Your Message: <br><input type="text" name="message" /> <br>
<input type="submit" />
</center>
</form>
<?php
$myFile = "conv.txt";
if ($_POST["user"] || $_POST["message"] != '')
{
if (filesize($myFile) >= '50000') ///if the file is over 50,000 bytes its starts new converstion
{
$fh = fopen($myFile, 'w') or die("can't open file"); ///opens conv.txt which is in your FTP server and writes a new conversation
$stringData = $_POST["user"] . ": " .$_POST["message"] . "\n"; ///puts the username which is in the textbox and the message which is in the textbox
fwrite($fh, $stringData); /// writes in conv.txt
fclose($fh); ///closes conv.txt
}
else ///if its not 50,000 bytes then it adds to the conversation
{
$fh = fopen($myFile, 'a') or die("can't open file"); ///opens conv.txt which is in your FTP server and appends to the conversation
$stringData = $_POST["user"] . ": " .$_POST["message"] . "\n"; ///puts the username which is in the textbox and the message which is in the textbox
fwrite($fh,$stringData); /// writes in conv.txt
fclose($fh); ///closes conv.txt
}
}
?>
save it as conversation.php and upload it to your FTP server
2nd make empty txt file whose name is conv.txt and upload it to your FTP server
3rd Open VB and add this code
Code:
Dim strHTML As String
Dim strConv As String
Dim lngCount As Long
Private Sub Command1_Click()
If Len(txtUser.Text) = 0 Then
MsgBox "Enter Username"
ElseIf Len(txtMessage.Text) = 0 Then
MsgBox "Enter Message"
Else
strHTML = HTTP.PostWrapper("http://YOURSITE.com/conversation.php", "user=" & txtUser.Text & "&message=" & txtMessage.Text, "http://YOURSITE.com/conversation.php")
txtMessage.Text = ""
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub Form_Load
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
strConv = HTTP.DownloadFile("http://YOURSITE.com/conv.txt", App.Path & "Conv.txt")
List1.Clear
LoadList List1, App.Path & "Conv.txt"
lngCount = List1.ListCount - 1
List1.ListIndex = lngCount
End Sub and remember to add these functions to HTTPWrapper
Code:
Private Function CheckForFile(filename) As Boolean
CheckForFile = (Dir(filename) <> "")
End Function
Public Function DownloadFile(URL As String, Path As String)
Dim Filenum As Integer, strHTML As String
If CheckForFile(Path) = True Then
Kill Path
End If
Filenum = FreeFile
strHTML = StripHeaders(GetWrapper(URL))
Open Path For Output As Filenum
Print #Filenum, strHTML
Close Filenum
End Function
Public Function StripHeaders(strHTML As String) As String
Dim strParts() As String
'Split at the two line break
strParts = Split(strHTML, vbCrLf & vbCrLf, 2)
StripHeaders = strParts(1) 'return the body
End Function
'FUNCTIONS RIPPED FROM RIPPERWRAPPER