title: Connection between HTML table and MySql database troubleshooting
body: <p>I can't find the misstake in the following code.
  I have a html Table with the fixed values item und price and calculated value total and the input value quantity</p>
  <p>the calculation.js works fine as well as the connection to the database.
  it just cant find the array keys and tells me this if i click the button</p>
  <pre><code>Warning: Undefined array key &quot;username&quot; in C:\xampp\htdocs\Kulinarik\order_save.php on line 7
  Warning: Undefined array key &quot;item&quot; in C:\xampp\htdocs\Kulinarik\order_save.php on line 8
  Warning: Undefined array key &quot;quantity&quot; in C:\xampp\htdocs\Kulinarik\order_save.php on line 9
  </code></pre>
  <p>this is the code</p>
  <p><strong>html</strong></p>
  <pre><code>                  &lt;form method=&quot;POST&quot; action=&quot;order_save.php&quot;&gt;  
                  &lt;table class=&quot;u-table-entity&quot; src=&quot;jquery.js&quot;&gt;
  
                    &lt;script scr=&quot;calculation.js&quot;&gt;&lt;/script&gt;
                    
                    &lt;colgroup&gt;
                      &lt;col width=&quot;20%&quot;&gt;
                      &lt;col width=&quot;2.1%&quot;&gt;
                      &lt;col width=&quot;22%&quot;&gt;
                      &lt;col width=&quot;21.7%&quot;&gt;
                      &lt;col width=&quot;34.2%&quot;&gt;
                    &lt;/colgroup&gt;
                    &lt;tbody class=&quot;u-table-alt-grey-5 u-table-body&quot;&gt;
                      &lt;tr style=&quot;height: 55px;&quot;&gt;
                        &lt;b&gt;
                        &lt;th class=&quot;u-table-cell u-table-cell-1&quot;&gt;&lt;b&gt;Produkt&lt;/b&gt;&lt;span style=&quot;font-weight: 700;&quot;&gt;&lt;/span&gt;
                        &lt;/th&gt;
                        &lt;th class=&quot;u-table-cell&quot;&gt;&lt;/th&gt;
                        &lt;th class=&quot;u-table-cell u-table-cell-3&quot;&gt;&lt;b&gt;Einzelpreis&lt;/b&gt;&lt;/th&gt;
                        &lt;th class=&quot;u-table-cell u-table-cell-4&quot;&gt;&lt;b&gt;Menge&lt;/b&gt;&lt;/th&gt;
                        &lt;th class=&quot;u-table-cell u-table-cell-5&quot;&gt;&lt;b&gt;Gesamtpreis&lt;/b&gt;&lt;/th&gt;
                        &lt;/b&gt;
                      &lt;/tr&gt;
                      &lt;tr style=&quot;height: 55px;&quot;&gt;
                        &lt;td class=&quot;u-table-cell&quot;&gt;
                            &lt;input type=&quot;text&quot; class=&quot;item&quot; value=&quot;Kornspitz&quot; name=&quot;item&quot; placeholder=&quot;Kornspitz&quot; readonly /&gt;
                        &lt;/td&gt;
                        &lt;td class=&quot;u-table-cell&quot;&gt;&lt;/td&gt;
                        &lt;td class=&quot;u-table-cell&quot;&gt;
                            &lt;input type=&quot;text&quot; class=&quot;price&quot; value=&quot;1.39&quot; name=&quot;price&quot; readonly/&gt;
                        &lt;/td&gt;
                        &lt;td class=&quot;u-table-cell&quot;&gt;
                          &lt;input type=&quot;text&quot; class=&quot;quantity&quot; name=&quot;quantity&quot;/&gt; 
                        &lt;/td&gt;
                        &lt;td class=&quot;u-table-cell&quot;&gt;
                          &lt;input type=&quot;text&quot; class=&quot;total&quot; name=&quot;total&quot; readonly/&gt;
                        &lt;/td&gt;
                      &lt;/tr&gt;
  
                      &lt;tr style=&quot;height: 55px;&quot;&gt;
                        &lt;td class=&quot;u-table-cell&quot;&gt;&lt;/td&gt;
                        &lt;td class=&quot;u-table-cell&quot;&gt;&lt;/td&gt;
                        &lt;td class=&quot;u-table-cell&quot;&gt;&lt;/td&gt;
                        &lt;td class=&quot;u-table-cell u-table-cell-19&quot;&gt; Gesamtpreis:&lt;/td&gt;
                        &lt;td class=&quot;u-table-cell&quot;&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr style=&quot;height: 56px;&quot;&gt;
                        &lt;td class=&quot;u-table-cell&quot;&gt;&lt;/td&gt;
                        &lt;td class=&quot;u-table-cell&quot;&gt;&lt;/td&gt;
                        &lt;td class=&quot;u-table-cell&quot;&gt;&lt;/td&gt;
                        &lt;td class=&quot;u-table-cell u-table-cell-24&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a class=&quot;u-active-none u-border-none u-btn u-button-link u-button-style u-hover-none u-none u-text-custom-color-1 u-text-hover-custom-color-2 u-btn-1&quot; href=&quot;https://nicepage.com&quot;&gt;AGB&lt;/a&gt;
                        &lt;/td&gt;
                        &lt;td class=&quot;u-table-cell u-table-cell-25&quot;&gt;
                          &lt;a class=&quot;u-border-none u-btn u-button-style u-custom-color-1 u-hover-custom-color-2 u-btn-2&quot; type=&quot;submit&quot; href=&quot;order_save.php&quot;&gt;BESTELLUNG&lt;/a&gt;
                        &lt;/td&gt;
                      &lt;/tr&gt;
                    &lt;/tbody&gt;
                  &lt;/table&gt;
                &lt;/form&gt;
  </code></pre>
  <p><strong>php</strong></p>
  <pre><code>&lt;?php
  session_start();
  ?&gt;
      &lt;?php
      $con= mysqli_connect('localhost','root','123456');
      mysqli_select_db($con, 'orders');
      $username = $_SESSION['username'];
      $item = $_POST['item'];
      $quantity = $_POST['quantity'];
      ?&gt;
  </code></pre>
  <p>the username i want to add is from the session_login
  maybe there is a way to add this too ?
  it is created with this code</p>
  <pre><code>&lt;?php
      session_start();
  ?&gt;
  &lt;?php
      $ldap_dn = &quot;uid=&quot;.$_POST[&quot;username&quot;].&quot;,dc=example,dc=com&quot;;
      $ldap_password = $_POST[&quot;password&quot;];
      $ldap_con = ldap_connect(&quot;ldap.forumsys.com&quot;);
      ldap_set_option($ldap_con, LDAP_OPT_PROTOCOL_VERSION, 3);
      if(@ldap_bind($ldap_con,$ldap_dn,$ldap_password))
          {
          $_SESSION['username'] = $_POST[&quot;username&quot;];
          header(&quot;Location: Startseite.php&quot;);
          }
      else
          {
          echo &quot;Invalid Credential&quot;;
          }
  ?&gt;
  </code></pre>
  <p>I would really appreciate your help
  thanks</p>