Show different content before and after logged in

bizz_koot

New Member
I want to show different div with different contents in different condition.If customer is logged in, then show content A, If customer is not logged in, then show content B,This is the script i have, not sure it is correct or not. \[code\]<?php if (!$logged) {$disp_div=1;} else { $disp_div=0;} ?>\[/code\]This is the Jquery\[code\]<script type="text/javascript" >$(document).ready(function(){var show=<?php echo $disp_div; ?> if(show==1) { $('#div_logged_in').show(); $('#div_not_logged_in').hide(); }else if(show==0) { $('#div_logged_in').hide(); $('#div_not_logged_in').show(); } });\[/code\]This is the HTML\[code\]<div id="div_logged_in">Content A</div><div id="div_not_logged_in">Content B</div>\[/code\]
 
Back
Top