how and where to record data in a session on octobercms










0















I would like to record the data of a form in a session



I find in the documentation that I have to use: Session::put('key', 'value');
but I do not know where to place this piece of code.



knowing that my form is located in the form_commun_1.htm page.



this is all the page :



title = "formulaire_commun_1"
url = "/formulaire_commun_1"
layout = "sidebar_layout"
is_hidden = 0
==





<ul class="progressbar">
<li class="active">transaction</li>
<li>details</li>
<li>confirmation</li>
</ul>

<br><br><br><br>




<form method="POST" action="" name="formu" accept-charset="UTF8" enctype="multipart/form-data">
<input type="hidden" name="_handler" value="onUpdate">
form_token()
form_sessionkey()
<div class="form-group">
<label for="TYPE_transaction" class="col-sm-3">type de transaction:</label>
<div class="col-sm-9">
<select class="form-control" id="TYPE_transaction">
<option>vendre</option>
<option>louer</option>

</select>
</div>
<br><br><br>


<p>choisissez un type de bien:</p>
<br><br>

<div class="col-sm-offset-2 col-sm-2">
<button class="btn btn-default" onclick="type_bien(0)"><img src=" 'assets/img/icones/icone_maison.png'"></button>
</div>
<div class="col-sm-offset-2 col-sm-2">

<button class="btn btn-default" onclick="type_bien(1)"><img src=" 'assets/img/icones/icone_villa.jpg'"></button>

</div>
<div class="col-sm-offset-2 col-sm-2">
<button class="btn btn-default" onclick="type_bien(2)"><img src="theme "></button>

</div>


<br><br><br><br><br>

<div class="col-sm-offset-2 col-sm-2">
<button class="btn btn-default" onclick="type_bien(3)"><img src=" 'assets/img/icones/icone_appartement.png'"></button>

</div>
<div class="col-sm-offset-2 col-sm-2">

<button class="btn btn-default" onclick="type_bien(4)"><img src=" 'assets/img/icones/icone_ferme.png'"></button>

</div>
<div class="col-sm-offset-2 col-sm-2">
<button class="btn btn-default" onclick="type_bien(5)"><img src=" 'assets/img/icones/icone_magasin.jpg'"></button>


</div>

<br><br><br><br>



<div class="radio" style="display: none;" >
<label><input type="radio" name="radio_type_bien" id=0 value="maison" ></label>

</div>
<div class="radio" >
<label><input type="radio" name="radio_type_bien" id=1 value="villa"></label>

</div>
<div class="radio" >
<label><input type="radio" name="radio_type_bien" id=2 value="riad" ></label>

</div>
<div class="radio" >
<label><input type="radio" name="radio_type_bien" id=3 value="appartement" ></label>

</div>
<div class="radio" >
<label><input type="radio" name="radio_type_bien" id=4 value="formulaire_appartement" ></label>

</div>
<div class="radio" >
<label><input type="radio" name="radio_type_bien" id=5 value="magasin" ></label>

</div>


<br><br><br><br><br><br



<div class=" col-sm-offset-3 col-sm-9">

<button type="submit" class="btn btn-default">Register</button>


</div></div>


</form>


<script type = "text/javascript">


function type_bien(x)

switch( x)
case 0:


document.getElementById(0).checked="true";
document.forms["formu"].action="formulaire_villa";


break;
case 1:

document.getElementById(1).checked="true";
document.forms["formu"].action="formulaire_villa";


break;
case 2:

document.getElementById(2).checked="true";
document.forms["formu"].action="formulaie_riad";

break;

case 3:


document.getElementById(3).checked="true";
document.forms["formu"].action="formulaire_appartement";


break;
case 4:

document.getElementById(4).checked="true";

break;
case 5:

document.getElementById(5).checked="true";

break;
default:
alert('local_commerce est selected');



</script>



do I have to go through creating a plugin or component ?
and where to put the session and how to use it?



please help?thank you










share|improve this question




























    0















    I would like to record the data of a form in a session



    I find in the documentation that I have to use: Session::put('key', 'value');
    but I do not know where to place this piece of code.



    knowing that my form is located in the form_commun_1.htm page.



    this is all the page :



    title = "formulaire_commun_1"
    url = "/formulaire_commun_1"
    layout = "sidebar_layout"
    is_hidden = 0
    ==





    <ul class="progressbar">
    <li class="active">transaction</li>
    <li>details</li>
    <li>confirmation</li>
    </ul>

    <br><br><br><br>




    <form method="POST" action="" name="formu" accept-charset="UTF8" enctype="multipart/form-data">
    <input type="hidden" name="_handler" value="onUpdate">
    form_token()
    form_sessionkey()
    <div class="form-group">
    <label for="TYPE_transaction" class="col-sm-3">type de transaction:</label>
    <div class="col-sm-9">
    <select class="form-control" id="TYPE_transaction">
    <option>vendre</option>
    <option>louer</option>

    </select>
    </div>
    <br><br><br>


    <p>choisissez un type de bien:</p>
    <br><br>

    <div class="col-sm-offset-2 col-sm-2">
    <button class="btn btn-default" onclick="type_bien(0)"><img src=" 'assets/img/icones/icone_maison.png'"></button>
    </div>
    <div class="col-sm-offset-2 col-sm-2">

    <button class="btn btn-default" onclick="type_bien(1)"><img src=" 'assets/img/icones/icone_villa.jpg'"></button>

    </div>
    <div class="col-sm-offset-2 col-sm-2">
    <button class="btn btn-default" onclick="type_bien(2)"><img src="theme "></button>

    </div>


    <br><br><br><br><br>

    <div class="col-sm-offset-2 col-sm-2">
    <button class="btn btn-default" onclick="type_bien(3)"><img src=" 'assets/img/icones/icone_appartement.png'"></button>

    </div>
    <div class="col-sm-offset-2 col-sm-2">

    <button class="btn btn-default" onclick="type_bien(4)"><img src=" 'assets/img/icones/icone_ferme.png'"></button>

    </div>
    <div class="col-sm-offset-2 col-sm-2">
    <button class="btn btn-default" onclick="type_bien(5)"><img src=" 'assets/img/icones/icone_magasin.jpg'"></button>


    </div>

    <br><br><br><br>



    <div class="radio" style="display: none;" >
    <label><input type="radio" name="radio_type_bien" id=0 value="maison" ></label>

    </div>
    <div class="radio" >
    <label><input type="radio" name="radio_type_bien" id=1 value="villa"></label>

    </div>
    <div class="radio" >
    <label><input type="radio" name="radio_type_bien" id=2 value="riad" ></label>

    </div>
    <div class="radio" >
    <label><input type="radio" name="radio_type_bien" id=3 value="appartement" ></label>

    </div>
    <div class="radio" >
    <label><input type="radio" name="radio_type_bien" id=4 value="formulaire_appartement" ></label>

    </div>
    <div class="radio" >
    <label><input type="radio" name="radio_type_bien" id=5 value="magasin" ></label>

    </div>


    <br><br><br><br><br><br



    <div class=" col-sm-offset-3 col-sm-9">

    <button type="submit" class="btn btn-default">Register</button>


    </div></div>


    </form>


    <script type = "text/javascript">


    function type_bien(x)

    switch( x)
    case 0:


    document.getElementById(0).checked="true";
    document.forms["formu"].action="formulaire_villa";


    break;
    case 1:

    document.getElementById(1).checked="true";
    document.forms["formu"].action="formulaire_villa";


    break;
    case 2:

    document.getElementById(2).checked="true";
    document.forms["formu"].action="formulaie_riad";

    break;

    case 3:


    document.getElementById(3).checked="true";
    document.forms["formu"].action="formulaire_appartement";


    break;
    case 4:

    document.getElementById(4).checked="true";

    break;
    case 5:

    document.getElementById(5).checked="true";

    break;
    default:
    alert('local_commerce est selected');



    </script>



    do I have to go through creating a plugin or component ?
    and where to put the session and how to use it?



    please help?thank you










    share|improve this question


























      0












      0








      0








      I would like to record the data of a form in a session



      I find in the documentation that I have to use: Session::put('key', 'value');
      but I do not know where to place this piece of code.



      knowing that my form is located in the form_commun_1.htm page.



      this is all the page :



      title = "formulaire_commun_1"
      url = "/formulaire_commun_1"
      layout = "sidebar_layout"
      is_hidden = 0
      ==





      <ul class="progressbar">
      <li class="active">transaction</li>
      <li>details</li>
      <li>confirmation</li>
      </ul>

      <br><br><br><br>




      <form method="POST" action="" name="formu" accept-charset="UTF8" enctype="multipart/form-data">
      <input type="hidden" name="_handler" value="onUpdate">
      form_token()
      form_sessionkey()
      <div class="form-group">
      <label for="TYPE_transaction" class="col-sm-3">type de transaction:</label>
      <div class="col-sm-9">
      <select class="form-control" id="TYPE_transaction">
      <option>vendre</option>
      <option>louer</option>

      </select>
      </div>
      <br><br><br>


      <p>choisissez un type de bien:</p>
      <br><br>

      <div class="col-sm-offset-2 col-sm-2">
      <button class="btn btn-default" onclick="type_bien(0)"><img src=" 'assets/img/icones/icone_maison.png'"></button>
      </div>
      <div class="col-sm-offset-2 col-sm-2">

      <button class="btn btn-default" onclick="type_bien(1)"><img src=" 'assets/img/icones/icone_villa.jpg'"></button>

      </div>
      <div class="col-sm-offset-2 col-sm-2">
      <button class="btn btn-default" onclick="type_bien(2)"><img src="theme "></button>

      </div>


      <br><br><br><br><br>

      <div class="col-sm-offset-2 col-sm-2">
      <button class="btn btn-default" onclick="type_bien(3)"><img src=" 'assets/img/icones/icone_appartement.png'"></button>

      </div>
      <div class="col-sm-offset-2 col-sm-2">

      <button class="btn btn-default" onclick="type_bien(4)"><img src=" 'assets/img/icones/icone_ferme.png'"></button>

      </div>
      <div class="col-sm-offset-2 col-sm-2">
      <button class="btn btn-default" onclick="type_bien(5)"><img src=" 'assets/img/icones/icone_magasin.jpg'"></button>


      </div>

      <br><br><br><br>



      <div class="radio" style="display: none;" >
      <label><input type="radio" name="radio_type_bien" id=0 value="maison" ></label>

      </div>
      <div class="radio" >
      <label><input type="radio" name="radio_type_bien" id=1 value="villa"></label>

      </div>
      <div class="radio" >
      <label><input type="radio" name="radio_type_bien" id=2 value="riad" ></label>

      </div>
      <div class="radio" >
      <label><input type="radio" name="radio_type_bien" id=3 value="appartement" ></label>

      </div>
      <div class="radio" >
      <label><input type="radio" name="radio_type_bien" id=4 value="formulaire_appartement" ></label>

      </div>
      <div class="radio" >
      <label><input type="radio" name="radio_type_bien" id=5 value="magasin" ></label>

      </div>


      <br><br><br><br><br><br



      <div class=" col-sm-offset-3 col-sm-9">

      <button type="submit" class="btn btn-default">Register</button>


      </div></div>


      </form>


      <script type = "text/javascript">


      function type_bien(x)

      switch( x)
      case 0:


      document.getElementById(0).checked="true";
      document.forms["formu"].action="formulaire_villa";


      break;
      case 1:

      document.getElementById(1).checked="true";
      document.forms["formu"].action="formulaire_villa";


      break;
      case 2:

      document.getElementById(2).checked="true";
      document.forms["formu"].action="formulaie_riad";

      break;

      case 3:


      document.getElementById(3).checked="true";
      document.forms["formu"].action="formulaire_appartement";


      break;
      case 4:

      document.getElementById(4).checked="true";

      break;
      case 5:

      document.getElementById(5).checked="true";

      break;
      default:
      alert('local_commerce est selected');



      </script>



      do I have to go through creating a plugin or component ?
      and where to put the session and how to use it?



      please help?thank you










      share|improve this question
















      I would like to record the data of a form in a session



      I find in the documentation that I have to use: Session::put('key', 'value');
      but I do not know where to place this piece of code.



      knowing that my form is located in the form_commun_1.htm page.



      this is all the page :



      title = "formulaire_commun_1"
      url = "/formulaire_commun_1"
      layout = "sidebar_layout"
      is_hidden = 0
      ==





      <ul class="progressbar">
      <li class="active">transaction</li>
      <li>details</li>
      <li>confirmation</li>
      </ul>

      <br><br><br><br>




      <form method="POST" action="" name="formu" accept-charset="UTF8" enctype="multipart/form-data">
      <input type="hidden" name="_handler" value="onUpdate">
      form_token()
      form_sessionkey()
      <div class="form-group">
      <label for="TYPE_transaction" class="col-sm-3">type de transaction:</label>
      <div class="col-sm-9">
      <select class="form-control" id="TYPE_transaction">
      <option>vendre</option>
      <option>louer</option>

      </select>
      </div>
      <br><br><br>


      <p>choisissez un type de bien:</p>
      <br><br>

      <div class="col-sm-offset-2 col-sm-2">
      <button class="btn btn-default" onclick="type_bien(0)"><img src=" 'assets/img/icones/icone_maison.png'"></button>
      </div>
      <div class="col-sm-offset-2 col-sm-2">

      <button class="btn btn-default" onclick="type_bien(1)"><img src=" 'assets/img/icones/icone_villa.jpg'"></button>

      </div>
      <div class="col-sm-offset-2 col-sm-2">
      <button class="btn btn-default" onclick="type_bien(2)"><img src="theme "></button>

      </div>


      <br><br><br><br><br>

      <div class="col-sm-offset-2 col-sm-2">
      <button class="btn btn-default" onclick="type_bien(3)"><img src=" 'assets/img/icones/icone_appartement.png'"></button>

      </div>
      <div class="col-sm-offset-2 col-sm-2">

      <button class="btn btn-default" onclick="type_bien(4)"><img src=" 'assets/img/icones/icone_ferme.png'"></button>

      </div>
      <div class="col-sm-offset-2 col-sm-2">
      <button class="btn btn-default" onclick="type_bien(5)"><img src=" 'assets/img/icones/icone_magasin.jpg'"></button>


      </div>

      <br><br><br><br>



      <div class="radio" style="display: none;" >
      <label><input type="radio" name="radio_type_bien" id=0 value="maison" ></label>

      </div>
      <div class="radio" >
      <label><input type="radio" name="radio_type_bien" id=1 value="villa"></label>

      </div>
      <div class="radio" >
      <label><input type="radio" name="radio_type_bien" id=2 value="riad" ></label>

      </div>
      <div class="radio" >
      <label><input type="radio" name="radio_type_bien" id=3 value="appartement" ></label>

      </div>
      <div class="radio" >
      <label><input type="radio" name="radio_type_bien" id=4 value="formulaire_appartement" ></label>

      </div>
      <div class="radio" >
      <label><input type="radio" name="radio_type_bien" id=5 value="magasin" ></label>

      </div>


      <br><br><br><br><br><br



      <div class=" col-sm-offset-3 col-sm-9">

      <button type="submit" class="btn btn-default">Register</button>


      </div></div>


      </form>


      <script type = "text/javascript">


      function type_bien(x)

      switch( x)
      case 0:


      document.getElementById(0).checked="true";
      document.forms["formu"].action="formulaire_villa";


      break;
      case 1:

      document.getElementById(1).checked="true";
      document.forms["formu"].action="formulaire_villa";


      break;
      case 2:

      document.getElementById(2).checked="true";
      document.forms["formu"].action="formulaie_riad";

      break;

      case 3:


      document.getElementById(3).checked="true";
      document.forms["formu"].action="formulaire_appartement";


      break;
      case 4:

      document.getElementById(4).checked="true";

      break;
      case 5:

      document.getElementById(5).checked="true";

      break;
      default:
      alert('local_commerce est selected');



      </script>



      do I have to go through creating a plugin or component ?
      and where to put the session and how to use it?



      please help?thank you







      laravel octobercms octobercms-plugins






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 14 '18 at 17:30







      Fati Alami

















      asked Nov 14 '18 at 16:08









      Fati AlamiFati Alami

      339




      339






















          1 Answer
          1






          active

          oldest

          votes


















          1














          I would recommend creating a plugin and component, but this isn't 100% necessary in your case.



          Here would be a basic self-contained page that would do what you are requesting:



          title = "test"
          url = "/test"
          layout = "default"
          is_hidden = 0
          ==
          <?php
          function onStart()

          $this['example'] = Session::get('example-key');


          function onTest()

          Session::put('example-key', input('my-input'));


          ?>
          ==

          <form data-request="onTest" data-request-success="location.reload();">
          <input type="text" name="my-input">
          <button type="submit">Submit</button>
          </form>

          % if example %
          <strong>Example: example </strong>
          % endif %


          I would recommend reading through the OctoberCMS documentation, it is excellent.






          share|improve this answer























          • thank you very much

            – Fati Alami
            Nov 15 '18 at 10:45











          • i have a question please: why did you chose to put session::put in the ontest() function ,can you please explain the difference between the too functions?

            – Fati Alami
            Nov 15 '18 at 10:54












          • Because of this data-request="onTest" . It will create session after clicking on submit button and when the next time page reloads, it will show your entered value. You can follow this article for more information - octobercms.com/docs/cms/pages

            – Mittul At TechnoBrave
            Nov 15 '18 at 13:05











          • thank you brother, you're great

            – Fati Alami
            Nov 15 '18 at 13:11











          • another problem please :is that i don't khow what to do with the form's action where will the form submit redirect;i don't want to refresh the page i want it to redirect to another page can help please

            – Fati Alami
            Nov 15 '18 at 14:04










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53304391%2fhow-and-where-to-record-data-in-a-session-on-octobercms%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          I would recommend creating a plugin and component, but this isn't 100% necessary in your case.



          Here would be a basic self-contained page that would do what you are requesting:



          title = "test"
          url = "/test"
          layout = "default"
          is_hidden = 0
          ==
          <?php
          function onStart()

          $this['example'] = Session::get('example-key');


          function onTest()

          Session::put('example-key', input('my-input'));


          ?>
          ==

          <form data-request="onTest" data-request-success="location.reload();">
          <input type="text" name="my-input">
          <button type="submit">Submit</button>
          </form>

          % if example %
          <strong>Example: example </strong>
          % endif %


          I would recommend reading through the OctoberCMS documentation, it is excellent.






          share|improve this answer























          • thank you very much

            – Fati Alami
            Nov 15 '18 at 10:45











          • i have a question please: why did you chose to put session::put in the ontest() function ,can you please explain the difference between the too functions?

            – Fati Alami
            Nov 15 '18 at 10:54












          • Because of this data-request="onTest" . It will create session after clicking on submit button and when the next time page reloads, it will show your entered value. You can follow this article for more information - octobercms.com/docs/cms/pages

            – Mittul At TechnoBrave
            Nov 15 '18 at 13:05











          • thank you brother, you're great

            – Fati Alami
            Nov 15 '18 at 13:11











          • another problem please :is that i don't khow what to do with the form's action where will the form submit redirect;i don't want to refresh the page i want it to redirect to another page can help please

            – Fati Alami
            Nov 15 '18 at 14:04















          1














          I would recommend creating a plugin and component, but this isn't 100% necessary in your case.



          Here would be a basic self-contained page that would do what you are requesting:



          title = "test"
          url = "/test"
          layout = "default"
          is_hidden = 0
          ==
          <?php
          function onStart()

          $this['example'] = Session::get('example-key');


          function onTest()

          Session::put('example-key', input('my-input'));


          ?>
          ==

          <form data-request="onTest" data-request-success="location.reload();">
          <input type="text" name="my-input">
          <button type="submit">Submit</button>
          </form>

          % if example %
          <strong>Example: example </strong>
          % endif %


          I would recommend reading through the OctoberCMS documentation, it is excellent.






          share|improve this answer























          • thank you very much

            – Fati Alami
            Nov 15 '18 at 10:45











          • i have a question please: why did you chose to put session::put in the ontest() function ,can you please explain the difference between the too functions?

            – Fati Alami
            Nov 15 '18 at 10:54












          • Because of this data-request="onTest" . It will create session after clicking on submit button and when the next time page reloads, it will show your entered value. You can follow this article for more information - octobercms.com/docs/cms/pages

            – Mittul At TechnoBrave
            Nov 15 '18 at 13:05











          • thank you brother, you're great

            – Fati Alami
            Nov 15 '18 at 13:11











          • another problem please :is that i don't khow what to do with the form's action where will the form submit redirect;i don't want to refresh the page i want it to redirect to another page can help please

            – Fati Alami
            Nov 15 '18 at 14:04













          1












          1








          1







          I would recommend creating a plugin and component, but this isn't 100% necessary in your case.



          Here would be a basic self-contained page that would do what you are requesting:



          title = "test"
          url = "/test"
          layout = "default"
          is_hidden = 0
          ==
          <?php
          function onStart()

          $this['example'] = Session::get('example-key');


          function onTest()

          Session::put('example-key', input('my-input'));


          ?>
          ==

          <form data-request="onTest" data-request-success="location.reload();">
          <input type="text" name="my-input">
          <button type="submit">Submit</button>
          </form>

          % if example %
          <strong>Example: example </strong>
          % endif %


          I would recommend reading through the OctoberCMS documentation, it is excellent.






          share|improve this answer













          I would recommend creating a plugin and component, but this isn't 100% necessary in your case.



          Here would be a basic self-contained page that would do what you are requesting:



          title = "test"
          url = "/test"
          layout = "default"
          is_hidden = 0
          ==
          <?php
          function onStart()

          $this['example'] = Session::get('example-key');


          function onTest()

          Session::put('example-key', input('my-input'));


          ?>
          ==

          <form data-request="onTest" data-request-success="location.reload();">
          <input type="text" name="my-input">
          <button type="submit">Submit</button>
          </form>

          % if example %
          <strong>Example: example </strong>
          % endif %


          I would recommend reading through the OctoberCMS documentation, it is excellent.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 15 '18 at 1:14









          Joseph OppegaardJoseph Oppegaard

          448311




          448311












          • thank you very much

            – Fati Alami
            Nov 15 '18 at 10:45











          • i have a question please: why did you chose to put session::put in the ontest() function ,can you please explain the difference between the too functions?

            – Fati Alami
            Nov 15 '18 at 10:54












          • Because of this data-request="onTest" . It will create session after clicking on submit button and when the next time page reloads, it will show your entered value. You can follow this article for more information - octobercms.com/docs/cms/pages

            – Mittul At TechnoBrave
            Nov 15 '18 at 13:05











          • thank you brother, you're great

            – Fati Alami
            Nov 15 '18 at 13:11











          • another problem please :is that i don't khow what to do with the form's action where will the form submit redirect;i don't want to refresh the page i want it to redirect to another page can help please

            – Fati Alami
            Nov 15 '18 at 14:04

















          • thank you very much

            – Fati Alami
            Nov 15 '18 at 10:45











          • i have a question please: why did you chose to put session::put in the ontest() function ,can you please explain the difference between the too functions?

            – Fati Alami
            Nov 15 '18 at 10:54












          • Because of this data-request="onTest" . It will create session after clicking on submit button and when the next time page reloads, it will show your entered value. You can follow this article for more information - octobercms.com/docs/cms/pages

            – Mittul At TechnoBrave
            Nov 15 '18 at 13:05











          • thank you brother, you're great

            – Fati Alami
            Nov 15 '18 at 13:11











          • another problem please :is that i don't khow what to do with the form's action where will the form submit redirect;i don't want to refresh the page i want it to redirect to another page can help please

            – Fati Alami
            Nov 15 '18 at 14:04
















          thank you very much

          – Fati Alami
          Nov 15 '18 at 10:45





          thank you very much

          – Fati Alami
          Nov 15 '18 at 10:45













          i have a question please: why did you chose to put session::put in the ontest() function ,can you please explain the difference between the too functions?

          – Fati Alami
          Nov 15 '18 at 10:54






          i have a question please: why did you chose to put session::put in the ontest() function ,can you please explain the difference between the too functions?

          – Fati Alami
          Nov 15 '18 at 10:54














          Because of this data-request="onTest" . It will create session after clicking on submit button and when the next time page reloads, it will show your entered value. You can follow this article for more information - octobercms.com/docs/cms/pages

          – Mittul At TechnoBrave
          Nov 15 '18 at 13:05





          Because of this data-request="onTest" . It will create session after clicking on submit button and when the next time page reloads, it will show your entered value. You can follow this article for more information - octobercms.com/docs/cms/pages

          – Mittul At TechnoBrave
          Nov 15 '18 at 13:05













          thank you brother, you're great

          – Fati Alami
          Nov 15 '18 at 13:11





          thank you brother, you're great

          – Fati Alami
          Nov 15 '18 at 13:11













          another problem please :is that i don't khow what to do with the form's action where will the form submit redirect;i don't want to refresh the page i want it to redirect to another page can help please

          – Fati Alami
          Nov 15 '18 at 14:04





          another problem please :is that i don't khow what to do with the form's action where will the form submit redirect;i don't want to refresh the page i want it to redirect to another page can help please

          – Fati Alami
          Nov 15 '18 at 14:04



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53304391%2fhow-and-where-to-record-data-in-a-session-on-octobercms%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Darth Vader #20

          How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

          Ondo