send a php variable as part of an html form -


i working on website didn't create , not have full access (i can create page , add html scripts not more) trying add form send data processed third-party servlet.

i trying include in form client id, saw can retrieved using php functionsession_id().

my question is, how send information along rest of input data.

my form this:

<form class="form-horizontal" action = "url" method="post" target="_blank"> <fieldset>  <!-- select basic --> <div class="form-group">   <label class="col-md-4 control-label" for="selectbasic">culture</label>   <div class="col-md-4">     <select id="crop" name="crop" class="form-control">       <option value="1">maïs</option>       <option value="2">ble</option>     </select>   </div> </div>  <!-- select basic --> <div class="form-group">   <label class="col-md-4 control-label" for="selectbasic">produit</label>   <div class="col-md-4">     <select id="product" name="product" class="form-control">       <option value="iodure d'azote">iodure d'azote</option>       <option value="desherbant">desherbant</option>     </select>   </div> </div>  <!-- text input--> <div class="form-group">   <label class="col-md-4 control-label" for="area">surface</label>     <div class="col-md-4">   <input id="area" name="area" type="text" placeholder=" " class="form-control input-md" required="">   <span class="help-block">en ha</span>     </div> </div>  <!-- text input--> <div class="form-group">   <label class="col-md-4 control-label" for="dose">dosage</label>     <div class="col-md-4">   <input id="dose" name="dose" type="text" placeholder="" class="form-control input-md" required="">   <span class="help-block">en l/ha</span>     </div> </div>  <div class="form-group">     <!--need actual id-->     <input type="hidden" value="1" name = "id"/>     <input type="submit" value="ajouter" /> </div>  </fieldset> </form> 

since first time handling web apps, there obvious i'm missing?

ok lacking basic understanding of php. sorry bothering, answer here had write

    <input type="hidden" value="<?php echo session_id();?>" name = "id"/> 

instead of

    <input type="hidden" value="1"name = "id"/> 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -