php - Limit form submission or data by level -


i have levels membership site. level 1,2,3. each level have dynamic form use submit data.

level 1 - 1 vet 1 pet level 2 - 1 vet multi pet level 3 - multi vet 1 pet

i having hard time figuring out how set limits posts. should setup counter , if in below code ?

   add_shortcode("gravity_form_user_data","gravity_form_user_data");    function gravity_form_user_data()    {    ob_start();    ?>    <link rel="stylesheet"     href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">    <script src="https://code.jquery.com/jquery-1.12.4.js"></script>    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>    <script>    jquery( function() {     jquery( "#accordion" ).accordion();    } );    </script>    <?php    $get_form_counter =     get_user_meta(get_current_user_id(),'form_counter',true);    echo "<h4>pet owner’s detail</h4>";     echo '<div id="accordion">';       for($i=0;$i<$get_form_counter;$i++)      {      $cus_info  = get_user_meta(get_current_user_id(),      'pmpro_form_data_'.$i,true);     echo '<h3>'.$cus_info['pmpro_custom_name'].'</h3>';      ?>      <div>     <form id="pmpro_submit_update_<?php echo $i ?>" action="" method="post"      enctype="multipart/form-data">     <div class="status alert alert-info" style="display: none;"></div>       <?php      /* level 2 code */     if(pmpro_hasmembershiplevel(2, get_current_user_id()))     {  ?>     <div class="vet_form_ak">     <?php echo update_vet_form($cus_info); ?>      </div>       <?php      $ak1 = get_user_meta(get_current_user_id(),'pmpro_form_data_0',true);     $ak_1 = $ak1['pmpro_custom_name'];     if(empty($ak_1))     {  ?>     <div class="pet_form_ak">     <?php echo update_pet_form($cus_info); ?>     </div>       <?php  }       ?>        <?php }       ?>       <?php  


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -