Z61 CHAT 1.1
Here is the place to post images, videos and downloads of your current and upcoming applications that you are working on.
mandai wrote:Surehey how would i make read in vb?
Code: Select allYou could take out the html and just have it as a php script, then your program can directly post/receive echoed messages, and since the server handles the chatlog your clients don't need even direct access to it.<form method="post"> <input name="u" value="user"> <input name="m" value="message"> <input type="submit"> </form> <?php if (array_key_exists("u", $_POST) && array_key_exists("m", $_POST)) { $chat = $_POST["u"] . ": " . $_POST["m"] . "\r\n"; echo $chat; $file = date("Y-n-j") . ".txt"; $fw = fopen($file , "a") or die("<div>Could not open, create or write to $file.</div>"); fwrite($fw, $chat) or die("<div>Could not write to $file.</div>"); fclose($fw); } ?>
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that 

First get rid of the input element, thats just if someone visits the page in a browser. Next you'll have to put that script on a PHP-enabled server.
Once its in place you can use this to post messages from the client:
Once its in place you can use this to post messages from the client:
Code: Select all
Then occasionally you can have the client refresh the chat log from the file that is stored on the server. Dim wc As WebClient = New WebClient()
Dim u As Uri = New Uri("http://localhost/chat.php")
Dim values As System.Collections.Specialized.NameValueCollection = New System.Collections.Specialized.NameValueCollection()
values.Add("u", "user")
values.Add("m", "message")
Dim data As Byte()
Try
data = wc.UploadValues(u, values)
Catch ex As Exception
MsgBox("Error posting chat: " & ex.Message)
Return
End Try
Dim chat As String = System.Text.Encoding.ASCII.GetString(data)
txtChat.Text += chat & vbCrLf
hey actually how can it read in the richtextbox ?
also i tested it and used textbox1 and hit send and in textbox1 i got this
also i tested it and used textbox1 and hit send and in textbox1 i got this
Code: Select all
Silluser: message
<br><table border='1' cellpadding='2' bgcolor='#FFFFDF' bordercolor='#E8B900' align='center'><tr><td><font face='Arial' size='1' color='#000000'><b>PHP Error Message</b></font></td></tr></table><br />
<b>Warning</b>: fopen(2010-5-24z61chat.txt) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied in <b>/home/a9136110/public_html/chat.php</b> on line <b>9</b><br />
<br><table border='1' cellpadding='2' bgcolor='#FFFFDF' bordercolor='#E8B900' align='center'><tr><td><div align='center'><a href='http://www.000webhost.com/'><font face='Arial' size='1' color='#000000'>Free Web Hosting</font></a></div></td></tr></table><div>Could not open, create or write to 2010-5-24z61chat.txt.</div>
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that 

That code looks hard I dont know how you would do this i would like to learn :P
Your web host is putting extra code in the bottom of the php script, plus it is blocking you from writing to/reading from the txt file.
Check your security settings to make sure scripts can read/write in the current directory.
Check your security settings to make sure scripts can read/write in the current directory.
On the 000webhost file manager you have to CHMOD It 777 basicly ' read/write in the current directory'
thank you lewis
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that 

Update b 1.2
I've decided that 1.1 was too buggy so im releasing a new version 1.2 with a login,register, music player and hopefully a updater since ive got the version checker complete so to it sends you to the website to download the update currently it is at 1.2 so it is to date but 1.2.1 will be the server chat changes it will revert back to 1.2 after each other day
I've decided that 1.1 was too buggy so im releasing a new version 1.2 with a login,register, music player and hopefully a updater since ive got the version checker complete so to it sends you to the website to download the update currently it is at 1.2 so it is to date but 1.2.1 will be the server chat changes it will revert back to 1.2 after each other day
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that 

Copyright Information
Copyright © Codenstuff.com 2020 - 2023