Salve,

ho necessità di inviare dati via POST/xmlhttp in Classic ASP ad una pagina PHP che si trova su un altro server.

Questo è il codice utilizzato:
codice:
Dim strPost, strResponse
strPost = "myvar=abcd123"
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", "http://www.mysite.com/script.php", False
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" 
xmlhttp.setRequestHeader "Content-Length", Len(strPost)
xmlhttp.send strPost 
if xmlhttp.status = 200 then
        strResponse = xmlhttp.responseText
        Response.Write( strResponse )
end if
Set xmlhttp = Nothing
Nella pagina PHP, per fare un test, ho scritto semplicemente del testo (ma proprio due caratteri) e poi richimato la variabile che in teoria gli dovrebbe essere arrivata tramite POST (tenendo ho presente che ho provato anche con GET).

Quindi nel file script.php PHP ho semplicemente:
codice:
<?php echo "abc ".$_POST['myvar'] ; ?>
Nel file asp ricevo correttamente la risposta e viene visualizzato il testo "abc " ma non la variable "myvar".

Qualcuno saprebbe dirmi dove sbaglio?!!

Grazie in anticipo!!