I am using the code below to send a message to my php script
i am having a couple of problems.
first, i cannot get it to send the string (msg) - if i put the arguments i want to pass in the addr variable, then those get sent correctly. the way i have it now is ok if i can get the message (msg) to send.
secondly i am looking for advice. this program is monitoring a data stream and every so often adds 1 character to a string. when that string length gets to be 254, the string gets added to a array of strings that is 512 entries long, is emptied and new data gets added to it. is it possible to send the contents of the array as the message? or am i going to end up looping through this 512 times (or however many entries are in the array when the timer kicks off). Would i be better off just sending the msg when the length gets to be 254?
and a final thought - if i keep msg to "", and in the I.UploadStringAsync(addr, msg) call i change it to
I.UploadStringAsync(addr + comments, msg)
will that cause a problem as the total length of addr + comments could be greater than 255
My VB.NET code:
Private Sub SendMessageNow(ByVal full As Boolean)
Dim name As String = System.Environment.UserName
Dim subject As String = Now.ToString
Dim I As New System.Net.WebClient
' here i have tried ="TESTING", ="comments=TESTING",="&comments=TESTING", etc
Dim msg As String = "comments=TESTING"
'if the name and subject are put in 'addr' then they get sent ok
' here i have tried with and without the + "&comments="
Dim addr As New Uri("http://mydomain.com/send.php?name=" + name + "&subject=" + subject)
marker = 0
***** Here is the code in my PHP script
$name = $_GET['name'] ;
$subject = $_GET['subject'] ;
// here i have tried both $_GET and $_POST
$comments = $_POST['comments'] ;
// comments is always delivered as ""