hi all...
im getting undefined index errors while running my code in localhost. im using wampserver 2.2...
but it works fine with older version of wampserver.
here is my example code for products page....
<?php
$man_id=$_GET['man_id'];
$man_name2=$_GET['manf_name'];
$man_name=str_replace('-',' ',$man_name2);
$cat_id=$_GET['cat_id'];
$cat_name2=$_GET['name'];
$cat_name= str_replace('-',' ',$cat_name2);
if($cat_id!=""):
?>
<span class="pro-head"><?php echo $cat_name;?></span>
<?php elseif($man_id!=""): ?>
<span class="pro-head"><?php echo $man_name;?></span>
<?php else:?>
<span class="pro-head">Products</span>
<?php endif;?>
<?php
$search_text=$_GET['keyword'];
$limit =10;$addLimit="";
if($_REQUEST['page']>0){
$page = $_REQUEST['page'];
$offset = ($page-1)*$limit;
}else $page=1;
if($offset>0) $limitingVal[] = $offset;
$limitingVal[] = $limit;
if(count($limitingVal)>0) $addLimit = "LIMIT ".implode(",",$limitingVal);
//echo "hi".$addLimit;
$param="";
if($man_id!=""):
$sql="select SQL_CALC_FOUND_ROWS * from tbl_product WHERE manf_id='$man_id' $addLimit";
$man_name1= str_replace(' ','-',$man_name);
$param = $param."man_id=$man_id&manf_name=$man_name1&";
elseif($cat_id!=""):
$sql="select SQL_CALC_FOUND_ROWS * from tbl_product WHERE cat_id='$cat_id' $addLimit";
$cat_name1=str_replace(' ','-',$cat_name);
$param = $param."cat_id=$cat_id&name=$cat_name1&";
elseif($search_text!=""):
$sql = "select A.*,B.cat_id from tbl_product A LEFT JOIN tbl_category B ON A.cat_id=B.cat_id where MATCH(A.search_title) AGAINST('$search_text' IN BOOLEAN MODE) OR A.prod_name LIKE '%$search_text%' OR A.prod_code LIKE '%$search_text%' OR B.cat_name LIKE '%$search_text%' AND A.status='Y' $addLimit";
else:
$sql="select SQL_CALC_FOUND_ROWS * from tbl_product $addLimit";
endif;
$obj->query($sql);
$nume=$obj->num_rows();
//echo "hi".$nume;
if($nume>0){
$sqlTotlCnt="SELECT FOUND_ROWS() as total_rows";
$resTotlCnt=mysql_query($sqlTotlCnt);
$totalNumRows = mysql_result($resTotlCnt, 0, 'total_rows');
$i=($page-1)*$limit;
while($row=$obj->query_fetch()) {
$i++;?>
<ul>
<li>
<img src="uploaded_images/products/thumb/<?php echo $row['image_path'];?>" style="width:254px; height:150px" />
<span class="pro-name"><?php echo $row['prod_name'];?></span>
<span class="pro-cat"><?php echo $row['short_desc'];?></span>
<?php if($row['promo_price']!=0) {?>
<span class="pro-amnt">Promo Price :$</span><h1><?php echo $row['promo_price'];?>*</h1>
<?php } else{?>
<span class="pro-amnt">Price :$</span><h1><?php echo $row['price'];?>*</h1>
<?php }?>
<a href="#"><img src="img/buynow.jpg" class="buy" /></a>
<a href="#"><img src="img/addcart.jpg" class="buy" /></a>
<a href="product_details.php?prod_id=<?php echo $row['prod_id'];?>&prod_name=<?php echo $row['prod_name'];?>"><img src="img/veiw-details.jpg" class="buy" /></a>
</li>
</ul>
<?php
//echo $row['prod_id'];
//$imgpath=$row['image_path'];
}
?>
<div class="pagination">
<?php //echo $totalNumRows."rows";
$total = $totalNumRows;
$pgng = $page;
$linktopage = "products.php?".$param;
$maxperpage = $limit;
include_once("includes/paging.php");
}
?>
and it shows the errors like this...
SCREAM: Error suppression ignored for
( ! ) Notice: Undefined index: man_id in C:\wamp\www\aaaa\products.php on line 35
Call Stack
# Time Memory Function Location
1 0.0034 138720 {main}( ) ..\products.php:0
( ! ) SCREAM: Error suppression ignored for
( ! ) Notice: Undefined index: manf_name in C:\wamp\www\aaaa\products.php on line 36
Call Stack
# Time Memory Function Location
1 0.0034 138720 {main}( ) ..\products.php:0
( ! ) SCREAM: Error suppression ignored for
( ! ) Notice: Undefined index: cat_id in C:\wamp\www\aaaa\products.php on line 38
Call Stack
# Time Memory Function Location
1 0.0034 138720 {main}( ) ..\products.php:0
( ! ) SCREAM: Error suppression ignored for
( ! ) Notice: Undefined index: name in C:\wamp\www\aaaa\products.php on line 39
Call Stack
# Time Memory Function Location
1 0.0034 138720 {main}( ) ..\products.php:0
pls help me to solve this.... tnx in advnc....