Skip to content Skip to sidebar Skip to footer

If The User Already Logged In Then The First Tab Will Hide And Directly Jump To The Second Tab

I have created a tab section without using Jquery UI. Now I have to set some condition on it. 1) If the user already logged in then the first tab will hide and directly jump to the

Solution 1:

for me i will use php direct jump to second tab

or u can set a var in js by php to control jump or not jump

not sure help or not


Solution 2:

if u load all the page together

<?php 
    $session=2;// example of session data value
?>    
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script>
$(function()
{ 
    $("[name='dv']").css("display","none");

    <?php 
    if(isset($session))
        echo"$('#d2').css('display','');";  
    else
        echo"$('#d1').css('display','');";
    ?>
});
</script>

<form>
<div id="d1" name="dv">
    reg page
</div>
<div id="d2" name="dv">
    tab 2
</div>
</form>

if u load the page one by one

<?php 
    $session=2;// example of session data value
?>

<form>
<?php if(isset($session))
{?>
<div id="d1" name="dv">
    reg page
</div>
<?php }
else
{
?>
<div id="d2" name="dv">
    tab 2
</div>
<?php }?>
</form>

not sure what u want , sorry

my English is too poor


Post a Comment for "If The User Already Logged In Then The First Tab Will Hide And Directly Jump To The Second Tab"