hey i am making an activation architecture in .net. I have written a script that posts the PHP variables, however, the PHP echos back a server response and i want to get that response back.
I have tried some code pieces but they don't work.
the sample php script is:
<?php
$name = $_POST['username'];
echo $name;
?>
i can't get the response, i.e. echo $name
, i cant get it please help
my code is:
Dim requestStream As Stream = request.GetRequestStream()
requestStream.Write(postBuffer, 0, postBuffer.Length)
Dim stream As Stream = request.GetResponse().GetResponseStream()
Dim reader As New StreamReader(stream)
Dim response As String
Dim newStream As Stream = request.GetRequestStream()
While response = reader.ReadLine()
response += reader.ReadLine()
End While
Return response
requestStream.Close()
thanks
You may want to check my Answer to this post. It's a bit more complicated than the answer you need, but it will solve your problem. The Second Example is what you want. But don't just copy it, you need the class and the reference too.
Hope it helps.