felipEx
Scripting Contest Winner
Posts: 378 Reputation: 24
35 / /
Joined: Jun 2006
|
RE: [?] Send using POST : httpwebrequests
it works fine for me
code: <?php
foreach($_POST as $nombre_campo => $valor){
echo "Var " . $nombre_campo . " = $valor \n";
}
?>
code: function OnEvent_Initialize(MessengerStart){
var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.open("POST", "http://felipex.net/test_posting.php");
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttp.send("a=1&b=2&c=3");
xmlHttp.onreadystatechange = function(){
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
Debug.Trace("Response: \n" + xmlHttp.responseText);
} else {
// Error...
}
}
}
}
This post was edited on 06-05-2007 at 04:23 AM by felipEx.
|
|