title: Trying to post web server PHP, multiple parameters not working VB
body: <p>Trying to POST to PHP to update database.</p>
  <p>If I do a single parameter it works fine but if I try two parameters it is not working.</p>
  <p>How do I post with two parameters?</p>
  <p>VisualBasic Code</p>
  <pre><code>        Dim dateTime As DateTime = ReturnAsDateTime(thedate, thetime)
          Dim dateformat2 As String = &quot;M/d/yyyy HH:mm&quot;
          Dim dateformat3 As String = dateTime.ToString(dateformat2)
          Dim StudentNOString As String = thestudent.Number.ToString()
          Dim upString As String = &quot;future01=&quot; &amp; dateformat3 &amp; &quot;StudentNumber=&quot; &amp; StudentNOString
  
  
          System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
          Dim request As WebRequest = WebRequest.Create(&quot;https://example.com/tofilePHPfile.php&quot;)
          request.Method = &quot;POST&quot;
          Dim byteArray As Byte() = Encoding.UTF8.GetBytes(upString)
          request.ContentType = &quot;application/x-www-form-urlencoded&quot;
          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)
  </code></pre>
  <p>PHP Code</p>
  <pre><code>&lt;?php
  
  // Create connection
  $conn = new mysqli($servername, $username, $password, $dbname);
  
  // Check connection
  if ($conn-&gt;connect_error) {
    die(&quot;Connection failed: &quot; . $conn-&gt;connect_error);
  }
  
  
  if (isset ($_POST[&quot;future01&quot;]) &amp;&amp; isset ($_POST[&quot;StudentNumber&quot;])){
      $future01 = $_POST[&quot;future01&quot;];
      $StudentNumber = $_POST[&quot;StudentNumber&quot;];
  } else {
      $future01 = &quot;testfortestfortest&quot;;
      $StudentNumber = &quot;1&quot;;
      echo &quot;not working&quot;;
  }
  
  $stmt = $conn-&gt;prepare(&quot;UPDATE pushtable SET future01=? WHERE StudentNumber=?&quot;);
  
  $stmt-&gt;bind_param('ss', $future01,$StudentNumber);
  
  $stmt-&gt;execute();
  
  echo $future01;
  //echo $StudentNumber;
  echo &quot;New records created successfully&quot;;
  
  $stmt-&gt;close();
  $conn-&gt;close();
  ?&gt;
  </code></pre>
  <p>There is something wrong with this line I think as the PHP is not posting it correctly.</p>
  <pre><code>   Dim upString As String = &quot;future01=&quot; &amp; dateformat3 &amp; &quot;StudentNumber=&quot; &amp; StudentNOString
  </code></pre>
  <p>I have tried dozens of different ways and tried to search for my problem but I cannot seem to find an answer. The PHP works perfectly well from IOS objective-c code. So, I think my problem is in the Visual Basic Code.</p>
  <p>future01 and StudentNumber are not being recognized individually when POST occurs.</p>
  <p>These are some of the pages I have looked at:</p>
  <p><a href="https://stackoverflow.com/questions/37770767/how-to-send-and-recieve-data-from-visual-basic-to-php">How to send and recieve data from Visual Basic to PHP?</a></p>
  <p><a href="https://www.informit.com/articles/article.aspx?p=131236&amp;seqNum=7" rel="nofollow noreferrer">https://www.informit.com/articles/article.aspx?p=131236&amp;seqNum=7</a></p>
  <p><a href="https://stackoverflow.com/questions/47027915/post-request-using-vbscript">POST Request using VBScript</a></p>
  <p><a href="https://stackoverflow.com/questions/2614762/multiple-key-value-pairs-in-http-post-where-key-is-the-same-name">Multiple key/value pairs in HTTP POST where key is the same name</a></p>
  <p><a href="https://stackoverflow.com/questions/30465184/how-can-i-send-multiple-variables-from-vb-net-to-php-via-post-method">How can i send multiple variables from vb.net to php via post method?</a></p>
  <p><a href="https://en.wikipedia.org/wiki/POST_(HTTP)#Use_for_submitting_web_forms" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/POST_(HTTP)#Use_for_submitting_web_forms</a></p>