I have a Daily Deals website of which I desire to limit the viewing of one of the product catagories to logged in users only. here is the catagory code.
<div class="categories">
<h3><?php echo $array['Categories'];?></h3>
<ul>
<?php
$category_total = num_rows(mkr_select('ig_category','cat_name,cat_id,cat_image','cat_status=1'));
$category_select = mkr_select('ig_category','cat_name,cat_id,cat_image','cat_status=1 ORDER BY cat_name ASC LIMIT 0,3');
if(num_rows($category_select)>0)
{
while($fetch_category = fetch_array($category_select))
{
?>
<li><a href="all_deals.php<?php echo $urladdon; ?>cat_id=<?php echo $fetch_category['cat_id']; ?>&cat_name=<?php echo $fetch_category['cat_name']; ?>" <?php if($_GET["cat_id"] == $fetch_category['cat_id']) { ?>class="categoriesactive" <?php } ?>><?php echo strtoupper($fetch_category['cat_name']); ?></a></li>
<?php
}
?>
<?php
$category_select2 = mkr_select('ig_category','cat_name,cat_id,cat_image','cat_status=1 ORDER BY cat_name ASC LIMIT 3,50');
while($fetch_category2 = fetch_array($category_select2))
{
?>
<li class="tgl"><a href="all_deals.php<?php echo $urladdon; ?>cat_id=<?php echo $fetch_category2['cat_id']; ?>&cat_name=<?php echo $fetch_category2['cat_name']; ?>" <?php if($_GET["cat_id"] == $fetch_category2['cat_id']) { ?>class="categoriesactive" <?php } ?>><?php echo strtoupper($fetch_category2['cat_name']); ?></a></li>
<?php
}
if($_GET["cat_id"] == "")
{
if($category_total>=3)
{
?>
<li class="more"><a style="cursor:pointer; text-align:right; font-size:12px;" id="viewall_a"><?php echo $array['View']; ?> >> </a></li>
<?php
}
?>
<li class="less"><a style="cursor:pointer; text-align:right; font-size:12px;" id="viewall_b"><?php echo $array['View']; ?> << </a></li>
<?php
}
}
?>
</ul>
</div>
Here is the portion I believe that concerns what I am trying to do.
<?php
$category_select2 = mkr_select('ig_category','cat_name,cat_id,cat_image','cat_status=1 ORDER BY cat_name ASC LIMIT 3,50');
while($fetch_category2 = fetch_array($category_select2))
{
?>
<li class="tgl"><a href="all_deals.php<?php echo $urladdon; ?>cat_id=<?php echo $fetch_category2['cat_id']; ?>&cat_name=<?php echo $fetch_category2['cat_name']; ?>" <?php if($_GET["cat_id"] == $fetch_category2['cat_id']) { ?>class="categoriesactive" <?php } ?>><?php echo strtoupper($fetch_category2['cat_name']); ?></a></li>
<?php
}
if($_GET["cat_id"] == "")
I know first I must check for the session if(isset($_SESSION[""]))
so if session is set show the requested content "cat_id=4". If session is unset direct viewer to login page. unset($_SESSION["login.php"]);
Am I anywhere close to warm?
Thank you in advance for any of your responses!