php - How to send multiple jQuery datepicker values to a database -


i creating website facilitates setting meeting time group of people, whenisgood.

when creating new meeting, users start inputting dates meeting possibly occur (using jquery datepicker form inputs). form starts 3 fields, users can add more needed. question is, how can store date values can used later? values used again in meeting creation process when users have select time range each submitted date value. also, final tentative schedule (days submitted , time ranges submitted) need made available group members. know, pretty abstract @ moment, , i'll more happy give more details if necessary. here page in question.

my main concern figuring out how store values without knowing how many values there be. if point me in right direction, appreciate it. have sql database have set , using. assume data stored there since, know, it's database. or if there's better way, that's cool too. in advance.

<?php  include 'core/init.php'; //protect_page(); include 'includes/overall/header.php';  ?>            <form action="sendemail.php" method="post">       <link rel="stylesheet" href="css/jquery-ui.css" />       <script src="js/jquery-1.9.1.js"></script>       <script src="js/jquery-ui.js"></script>       <script>            $(document).ready(function() {                 var count = 4;                 $(".datepicker").datepicker({ dateformat: 'yy-mm-dd', mindate: '+0d', numberofmonths: 2});                 $( 'input[type="text"]' ).datepicker();                  $("#adddate").click(function(){                      $('#dateholder').append('<p>date: <input id="dp' + count + '" type="text" class="datepicker" /></p>');                      count++;                      $(".datepicker").datepicker({ dateformat: 'yy-mm-dd', mindate: '+0d', numberofmonths: 2});                      $( 'input[type="text"]' ).datepicker();                 });            });                      </script>        <h1>create meeting</h1>       <div style="display: inline-block; margin-left: 20%;">       <div id="dateholder" style="text-align:center;">            <p>date: <input id="dp1" type="text" class="datepicker" /></p>            <p>date: <input id="dp2" type="text" class="datepicker" /></p>            <p>date: <input id="dp3" type="text" class="datepicker" /></p>       </div>       <div style="text-align:center;">            <p><input type="button" value="add date" id="adddate" /> <input type="submit" value="submit dates"/></p>       </div>       </div>       </form>  <?php include 'includes/overall/footer.php'; ?> 

you can replace

<p>date: <input id="dp1" type="text" class="datepicker" /></p> <p>date: <input id="dp2" type="text" class="datepicker" /></p> <p>date: <input id="dp3" type="text" class="datepicker" /></p> 

with

<p>date: <input name="dp[]" type="text" class="datepicker" /></p> 

after can read in php page:

<?php     ($i = 0; $i < count($_post['dp']); $i++){        echo $_post['dp'][$i]."<br/>";            }   ?> 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -