-2

I am working on a website which I didn't create and to which I do not have full access (I can create a page and add html scripts but not much more) I am trying to add a form which will send data to be processed by a third-party servlet.

I am trying to include in this form the client ID, which I saw can be retrieved using the php functionsession_id().

My question is, how to send this information along with the rest of the input data.

my form for now is 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 to get the actual id-->
    <input type="hidden" value="1" name = "ID"/>
    <input type="submit" value="Ajouter" />
</div>

</fieldset>
</form>

Since this is my first time handling web apps, is there something obvious i'm missing?

Adalcar
  • 1,458
  • 11
  • 26

1 Answers1

1

OK i was lacking basic understanding of php. sorry for bothering, the answer was here i just had to write

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

instead of

    <input type="hidden" value="1"name = "ID"/>
Community
  • 1
  • 1
Adalcar
  • 1,458
  • 11
  • 26