R
RGHAREEB
Guest
I'm trying to senD values to PHP from visual Studio, then insert these values to mysql database but values inserted as blanks
i found this code
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim Username = txtname.text
Dim PostData = "user_name=" & Username
Dim request As WebRequest = WebRequest.Create("XXX Sex & Free Porn Videos on XXX.com")
request.Method = "POST"
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(PostData)
request.ContentType = "application/x-www-form-urlencoded"
request.ContentLength = byteArray.Length
Dim dataStream As Stream = request.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
'dataStream.Close()
Dim response As WebResponse = request.GetResponse()
dataStream = response.GetResponseStream()
Dim reader As New StreamReader(dataStream)
Dim responseFromServer As String = reader.ReadToEnd()
reader.Close()
dataStream.Close()
response.Close()
MsgBox(responseFromServer)
End Sub
**** my php file
<?php
$username=$_POST['user_name'];
echo "username is :".$username;
?>
username value sent as is blank
how can i fix it ?
Continue reading...
i found this code
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim Username = txtname.text
Dim PostData = "user_name=" & Username
Dim request As WebRequest = WebRequest.Create("XXX Sex & Free Porn Videos on XXX.com")
request.Method = "POST"
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(PostData)
request.ContentType = "application/x-www-form-urlencoded"
request.ContentLength = byteArray.Length
Dim dataStream As Stream = request.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
'dataStream.Close()
Dim response As WebResponse = request.GetResponse()
dataStream = response.GetResponseStream()
Dim reader As New StreamReader(dataStream)
Dim responseFromServer As String = reader.ReadToEnd()
reader.Close()
dataStream.Close()
response.Close()
MsgBox(responseFromServer)
End Sub
**** my php file
<?php
$username=$_POST['user_name'];
echo "username is :".$username;
?>
username value sent as is blank
how can i fix it ?
Continue reading...