4892: PHP Undefined warnings: index.php: $is_for_category, index "p"
authorTJ <acontent@iam.tj>
Wed, 19 Oct 2011 19:58:46 +0000 (20:58 +0100)
committerTJ <acontent@iam.tj>
Wed, 19 Oct 2011 19:58:46 +0000 (20:58 +0100)
home/index.php

index 2918c64..33e1bd4 100644 (file)
@@ -43,6 +43,7 @@ if (isset($_GET['action'], $_GET['cid']) && $_SESSION['user_id'] > 0)
 //     $is_my_courses = true; 
 //}
 
+$is_for_category = false;
 if (isset($catid)) {
        $courses = $coursesDAO->getByCategory($catid);
        $is_for_category = true;
@@ -52,7 +53,7 @@ if (isset($catid)) {
 
 require(TR_INCLUDE_PATH.'header.inc.php'); 
 
-$curr_page_num = intval($_GET['p']);
+$curr_page_num = intval(isset($_GET['p']) ? $_GET['p'] : 0);
 if (!$curr_page_num) {
        $curr_page_num = 1;
 }
@@ -68,4 +69,4 @@ if ($is_for_category) {
 $savant->display('home/index_course.tmpl.php');
 
 require(TR_INCLUDE_PATH.'footer.inc.php'); 
-?>
\ No newline at end of file
+?>