I have been designing a shopping website lately in PHP. Now in Checkout page i have to check many times if the user is logged in. i.e If the user is logged in hide the Signin div and show the Shipping div.
<section class="panels <?php if(!isset($_SESSION['username'])) echo"unactivepanel"; else echo"activepanel";?>" id="Sign In">
<div class="wrapper1" >
<ul>
<li><input type="email" placeholder="Enter your email address" required/></li>
<li class="inf">(will only be used for sending you order information.)</li>
<fieldset><legend class="orb"> OR</legend>
<li><input type="button" value="Sign In to booksmore" class="sb si llb" /></li></fieldset>
<fieldset><legend class="orb"> OR</legend>
<li>Sign In using any of following service:</li>
<li>
<div class="box1 fc">Facebook</div>
<div class="box1 tw">Twitter</div>
<div class="box1 gg">Google</div>
<div class="box1 oi">Open Id</div>
</li></fieldset>
</ul>
</div>
</section>
<section class="panels <?php if(!isset($_SESSION['username'])) echo"unactivepanel"; else echo"activepanel";?>unactivepanel" id="Shipping"></section>
<section class="panels unactivepanel" id="Confirm"></section>
What i have studied is using too many if block slows down the executions speed, So am I right using too many if blocks ? if I am not coding it right(what i feel right now) then what may be the possible alternatives to if blocks ? (I was thinking of using switch block.)