0

i'm trying to link a php label to a html block of code the problem is using inline code the label appears to be empty.Please help.

<?php                                        
    if ($count==0){                                          
       goto department;                                      
    }else{                                   
       $count+=1;                                            
       goto next_block;                                      
    }
?>

<?php
    department:{
?>

<div>
    <td id="hide-department" name="queried_dept">
        <div class="list-group" name="Department" id="Department">                              
            <a href="#" class="list-group-item list-group-item-action">
                <?php echo $row['DEP NAME'];?>
            </a>                                             
        </div>                                       
    </td>
</div>

<?php
    {
?>
  • 3
    [Why on earth would you want anything like that to begin with?](https://stackoverflow.com/questions/3517726/what-is-wrong-with-using-goto) – misorude Jul 30 '19 at 14:09
  • @misorude It may be unorthodox, but goto is a valid PHP control structure. You can even jump backwards in code using goto: https://www.php.net/manual/en/control-structures.goto.php – Zizzyzizzy Jul 30 '19 at 14:54
  • Sean, "the label appears to be empty". Could you explain please? What label? Are you talking about the div inline code? – Zizzyzizzy Jul 30 '19 at 14:55

0 Answers0