douzaipou3327 2019-03-29 16:07
浏览 90

如果提交的所有字段都不为空,则显示表格中的问题

I have three fields which are related to each other and i am getting 2nd value after submitting the 1st varibale and 3rd value after submitting 2nd field

I have these 3 fields which are interrelated to each other

<?php 

    $courtname='';

    if(!empty($_POST['court_name']))
    {
      $courtname=$_POST['court_name'];
     }


    $category='';

    if(!empty($_POST['category']))
    {
      $category=$_POST['category'];
    }

    $lawyer_name='';

    if(!empty($_POST['lawyer_name']))
    {
      $lawyer_name=$_POST['lawyer_name'];
    }


?>

And i want to show this div part only when all the above 3 fields are submitted

<?php 
if($lawyer_name!=="" && $courtname!=="" && $category!==""){?>
    <div>
!--- Some Code ----!

    </div> 
<?php } ?>

But this if condition is not working ..and div part is showing after submitting 2 fields ..Its not checking for 3rd condition .

I have also used

<?php  if(!empty($_POST['court_name']) && !empty($_POST['category']) && !empty($_POST['lawyer_name'])   ){ ?>

but that's also not working.

  • 写回答

1条回答 默认 最新

  • douman9420 2019-03-29 16:35
    关注

    Try with :

    <?php  
      if( isset($_POST['court_name']) && isset($_POST['category']) && !isset($_POST['lawyer_name'])   ){ 
      // code
      }
    
    ?>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)