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?><scriptsrc="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script><script>
$(function()
{ 
    $("[name='dv']").css("display","none");

    <?phpif(isset($session))
        echo"$('#d2').css('display','');";  
    elseecho"$('#d1').css('display','');";
    ?>
});
</script><form><divid="d1"name="dv">
    reg page
</div><divid="d2"name="dv">
    tab 2
</div></form>

if u load the page one by one

<?php$session=2;// example of session data value?><form><?phpif(isset($session))
{?><divid="d1"name="dv">
    reg page
</div><?php }
else
{
?><divid="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"