title: how to open bootstrap modal with different PHP value
body: <p>i have a php app with 3 table, each one have multiple row with button for each row to get a form for the affected data</p>
  <p>the idea is to give a value for the modal to have as much column as in the affected table.</p>
  <p>until now, i tried to have one form with button fo each table, with different value, and testing it in php to use the correct table for for the column as below in the code (it's a test webpage so there is just one button, i'm just trying to open a modal manually after testing a php value ) :</p>
  <pre><code>&lt;body&gt;
  &lt;form action=&quot;&quot; method=&quot;post&quot;&gt;
      &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot; data-bs-toggle=&quot;modal&quot; data-bs- 
          target=&quot;#CreateInfra&quot; name=&quot;der&quot;&gt;
          Launch demo modal
      &lt;/button&gt;
  &lt;/form&gt;
  &lt;script&gt;
      function modal(){
              $(&quot;#myModal&quot;).modal('show');
      }
  &lt;/script&gt;
  &lt;div class=&quot;bs-example&quot;&gt;
      &lt;!-- Modal HTML --&gt;
      &lt;div id=&quot;myModal&quot; class=&quot;modal fade&quot; tabindex=&quot;-1&quot;&gt;
          &lt;div class=&quot;modal-dialog&quot;&gt;
              &lt;div class=&quot;modal-content&quot;&gt;
                  &lt;div class=&quot;modal-header&quot;&gt;
                      &lt;h5 class=&quot;modal-title&quot;&gt;Modal Title&lt;/h5&gt;
                      &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot;&gt;&amp;times;&lt;/button&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;modal-body&quot;&gt;
                      &lt;p&gt;This is a simple Bootstrap modal. Click the &quot;Cancel button&quot;, &quot;cross icon&quot; or 
                      &quot;dark gray area&quot; to close or hide the modal.&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;modal-footer&quot;&gt;
                      &lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; data 
                          dismiss=&quot;modal&quot;&gt;Cancel&lt;/button&gt;
                      &lt;button type=&quot;button&quot; class=&quot;btn btn-primary&quot;&gt;Save&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
      &lt;?php
      if (isset($_POST['der'])){
          $value = 1;
          var_dump($value);
      }
      else{
          $value=2;
          var_dump($value);
      }
  
      if ($value == 1){
          echo &quot;&lt;script&gt;modal()&lt;/script&gt;&quot;;
  
      }
      ?&gt;
  
  &lt;/body&gt;
  </code></pre>
  <p>the thing is , when i hit the button, i see my page loading something for maybe 0.4 second but nothing happen.</p>
  <p>is there any way to do this or i should use something else ?</p>