send messages to a server - Printable Version
-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: send messages to a server (/showthread.php?tid=71933)
send messages to a server by ab5000 on 02-19-2007 at 08:24 PM
hello.
i need to a send message to a server and receive the response.
can you help me?
thanks to all.
P.sorry for my bad english
RE: send messages to a server by Evertje on 02-19-2007 at 11:13 PM
Hi..
How would you do that?! Trough FTP or sending it trough a php file, to a Sql server?!
P.s. My english is also fucked up.. So, no worrie's about it!!
RE: send messages to a server by Matti on 02-20-2007 at 09:03 AM
Well, if you want to send a request to a PHP file using GET- or POST-statements and receive the returned data, you can use the XMLHTTP ActiveX object. An example code would be:
code: var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
//Replace"POST" by "GET" if you want to use GET-statements
//Enter your URL in the 2nd parameter
xmlhttp.open("POST", "http://www.mysite.com/myscriptpage.php", true);
//Remove the following line if you want to use GET instead of POST.
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
//Enter the statements which have to be sent, separated by a &-sign.
//Ex: a=5&b=myscript
xmlhttp.send("a=5&b=myscript");
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState==4) {
if(xmlhttp.status == 200){
//It worked, we have a response!
Debug("Yay! Success! Here's the returned HTML:");
Debug.Trace(html.responseText);
}else{
//Hmm... something went wrong here...
Debug.Trace("Mayday, Mayday, we have an XMLHTTP error!");
}
}
}
RE: send messages to a server by Volv on 02-20-2007 at 09:24 AM
Yes, I believe Mattike's suggestion would be the easiest and most suitable.
RE: send messages to a server by ab5000 on 02-20-2007 at 07:03 PM
i need to comunicate to a server, connecting to a port, and sending information with a my protocol!
|