title: How to post from vue form to php file in Vue.js
body: <p>I am working with vue.js and php /I have this Vue form and i want selected elements to be posted to php file. how can I do that. I need the selected elements in the php page as a post variable. Help please. what are the possible options to achieve the task. </p>
  
  <pre><code>&lt;template&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-lg-offset-3 col-md-offset-2 col-sm-offset-2 col-lg-6 col-md-8 col-sm-8"&gt;
              &lt;div class="form-group"&gt;
                  &lt;h3&gt;&lt;i class="fa fa-file-excel-o"&gt;&lt;/i&gt;&amp;nbsp;Fixed Asset Report2&lt;/h3&gt;
              &lt;/div&gt;
  
              &lt;divider&gt;&lt;/divider&gt;
  
              &lt;!-- category / status --&gt;
              &lt;div class="form-group"&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-lg-6 col-md-6"&gt;
                          &lt;label class="control-label"&gt;Category&lt;/label&gt;
                          &lt;select
                                  class="form-control input-lg"
                                  v-model="query.category"
                                  placeholder="Select Category"&gt;
                              &lt;option value=""&gt;-- Report All Category --&lt;/option&gt;
                              &lt;option
                                      v-for="category in categoryList"
                                      track-by="$index"
                                      :value="category"
                                      v-text="category"&gt;&lt;/option&gt;
                          &lt;/select&gt;
                      &lt;/div&gt;
  
                      &lt;div class="col-lg-6 col-md-6"&gt;
                          &lt;label class="control-label"&gt;Status&lt;/label&gt;
                          &lt;select
                                  class="form-control input-lg"
                                  v-model="query.status"
                                  placeholder="Select Status"&gt;
                              &lt;option value=""&gt;-- Report All Status --&lt;/option&gt;
                              &lt;option
                                      v-for="status in statusList"
                                      track-by="$index"
                                      :value="status"
                                      v-text="status"&gt;&lt;/option&gt;
                          &lt;/select&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;!-- ./ category / status --&gt;
  
              &lt;divider&gt;&lt;/divider&gt;
  
              &lt;div class="form-group"&gt;
                  &lt;checkbox
                          :model.sync="query.date"
                          true-message="List Within Specified Range (Acquisition Date)"
                          false-message="List Within Specified Range (Acquisition Date)"&gt;&lt;/checkbox&gt;
              &lt;/div&gt;
  
              &lt;!-- start / end --&gt;
              &lt;div
                      class="form-group"
                      v-show="query.date === true"
                      transition="fade"&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-lg-6 col-md-6"&gt;
                          &lt;label class="control-label"&gt;Start &lt;code&gt;DD-MM-YYYY&lt;/code&gt;*&lt;/label&gt;
                          &lt;date-time
                                  format="YYYY-MM-DD"
                                  display-format="DD-MM-YYYY"
                                  class="form-control input-lg"
                                  :required="true"
                                  :model.sync="query.start"&gt;&lt;/date-time&gt;
  
                          &lt;small
                                  class="help-block"
                                  v-show="query.start.length &lt; 1"&gt;&lt;code&gt;Start&lt;/code&gt; is required&lt;/small&gt;
                      &lt;/div&gt;
  
                      &lt;div class="col-lg-6 col-md-6"&gt;
                          &lt;label class="control-label"&gt;End &lt;code&gt;DD-MM-YYYY&lt;/code&gt;*&lt;/label&gt;
                          &lt;date-time
                                  format="YYYY-MM-DD"
                                  display-format="DD-MM-YYYY"
                                  class="form-control input-lg"
                                  :required="true"
                                  :model.sync="query.end"&gt;&lt;/date-time&gt;
  
                          &lt;small
                                  class="help-block"
                                  v-show="query.end.length &lt; 1"&gt;&lt;code&gt;End&lt;/code&gt; is required&lt;/small&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;!-- ./ start / end --&gt;
  
              &lt;divider&gt;&lt;/divider&gt;
  
              &lt;div class="form-group"&gt;
                  &lt;label class="control-label"&gt;Select Columns to export to CSV&lt;/label&gt;
  
                  &lt;!-- filter --&gt;
                  &lt;div class="row"&gt;
                      &lt;!-- toggle --&gt;
                      &lt;div class="col-lg-12"&gt;
                          &lt;checkbox
                                  :model.sync="all"
                                  true-message="Select All"
                                  false-message="Select None"&gt;&lt;/checkbox&gt;
                      &lt;/div&gt;
                      &lt;!-- ./ toggle --&gt;
  
                      &lt;!-- filters --&gt;
                      &lt;div class="col-lg-6" v-for="(k, f) in filter" track-by="$index"&gt;
                          &lt;checkbox
                                  :model.sync="filter[k].show"
                                  :true-message="f.label"
                                  :false-message="f.label"&gt;&lt;/checkbox&gt;
                      &lt;/div&gt;
                      &lt;!-- ./ filters --&gt;
                  &lt;/div&gt;
                  &lt;!-- ./ filter --&gt;
              &lt;/div&gt;
  
              &lt;divider&gt;&lt;/divider&gt;
  
              &lt;div class="form-group text-center"&gt;
                  &lt;button
                          type="button"
                          class="btn btn-lg btn-success-outline"
                          @click="generate"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;i class="fa fa-file-excel-o"&gt;&lt;/i&gt;&amp;nbsp;&amp;nbsp;Download Report&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>PHP file</p>
  
  <pre><code>&lt;?php
  $__REST__['REPORT_FOR_FIXED_ASSET'] = function($routeInfo) {
      if ($_POST){
  
          die(print_r($_POST));
      }
  
  
  };
  </code></pre>