php - can I $_POST multiple assoc. arrays -


i am.working on user input availability database. order standardize information, want use more 1 mulitiple select inputs.

    <form method="post" action=''example.php"> gamerid:<input ="text" name ="gamerid"/></br>  monday:<select name="monday[]" multiple="multiple">  <option>select availability</option> <option value="4">4pm</option> <option value="5">5pm</option> <option value="6">6pm</option> <option value="7">7pm</option> <option value="8">8pm</option> <option value="9">9pm</option> <option value="10">10pm</option> <option value="11">11pm</option> <option value="12">12pm</option> <option value="1a">1am</option> </select> </br>  tuesday:<select name="tuesday[]"multiple="multiple">  <option>select availability</option> <option value="4">4pm</option> <option value="5">5pm</option> <option value="6">6pm</option> <option value="7">7pm</option> <option value="8">8pm</option> <option value="9">9pm</option> <option value="10">10pm</option> <option value="11">11pm</option> <option value="12">12pm</option> <option value="1a">1am</option> </select> </br>  wednesday:<select name="wednesday[]" multiple="multiple">  <option>select availability</option> <option value="4">4pm</option> <option value="5">5pm</option> <option value="6">6pm</option> <option value="7">7pm</option> <option value="8">8pm</option> <option value="9">9pm</option> <option value="10">10pm</option> <option value="11">11pm</option> <option value="12">12pm</option> <option value="1a">1am</option> </select> </br> 

etc every day of week.. far, believe code correct post seems not appreciate it. possible..? end goal serialise $_post arrays, strings, store them in sql db.

any here appreciated.

in action page array using implode can convert string can insert in database.

try code.

    <form method="post"> tuesday:<select name="tuesday[]"multiple="multiple">  <option>select availability</option> <option value="4">4pm</option> <option value="5">5pm</option> <option value="6">6pm</option> <option value="7">7pm</option> <option value="8">8pm</option> <option value="9">9pm</option> <option value="10">10pm</option> <option value="11">11pm</option> <option value="12">12pm</option> <option value="1a">1am</option> </select>  <input type="submit" name="submit"> </form> <?php if(isset($_post['submit'])){ $var=$_post['tuesday']; echo implode(",",$var); } ?> 

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -