0

I have total 6 multiple select lists when i select any one or multiple option from these lists i will show them after form submission, initially they hidden. Below is my script this is works fine in localhost but i am getting syntax error in production PHP Parse error: syntax error, unexpected 'isset'(T_ISSET). Please someone help me, Thanks in advance

    <script>
    <?php if(isset($_POST['LS_name']) && !empty(isset($_POST['LS_name']))) { ?>
            $('.mystaff_opt1').collapse('show');
    <?php } ?> 
    <?php if(isset($_POST['FamilyIncome']) && !empty(isset($_POST['FamilyIncome']))){ ?>
        $('.mystaff_opt2').collapse('show');
    <?php } ?> 
    <?php if(isset($_POST['Religion']) && !empty(isset($_POST['Religion']))){ ?>
        $('.mystaff_opt3').collapse('show');
    <?php } ?> 
    <?php if(isset($_POST['Category']) && !empty(isset($_POST['Category']))){ ?>
        $('.mystaff_opt4').collapse('show');
    <?php } ?> 
    <?php if(isset($_POST['Gender']) && !empty(isset($_POST['Gender']))){ ?>
        $('.mystaff_opt5').collapse('show');
    <?php } ?> 
    <?php if(isset($_POST['State']) && !empty(isset($_POST['Gender']))){ ?>
        $('.mystaff_opt6').collapse('show');
    <?php } ?>  
    </script>
Mahantesh
  • 347
  • 5
  • 20

1 Answers1

0

I'm not sure your code is quite right:

<?php if(isset($_POST['LS_name']) && !empty(isset($_POST['LS_name']))) { ?>

This is testing if the variable is set (which it is if you get to the second condition) and then tests !empty(true)

Perhaps that should be:

if (isset($_POST['LS_name']) && !empty($_POST['LS_name'])) {

Lastly - which line is the error reporting. Check carefully the bracketing and quotes being used on that line.

muz the axe
  • 418
  • 2
  • 17