if ($row['pd_image3']) {
$row['pd_image3'] = WEB_ROOT . 'images/product/' . $row['pd_image3'];
} else {
$row['pd_image3'] = WEB_ROOT . 'images/no-image-large1.png';
} resim eklemeyince hiçbir şey gözükmesin
11
●761
- 04-09-2010, 12:36:30Aşağıda verdiğim kodda da göründüğü gibi, resim eklemeyince no-image-large1.png adlı resim dosyası görünüyor. bense resim eklemeyince hiçbir şey gözükmesin istiyorum. bunu nasıl sağlayabilirim ?
- 04-09-2010, 12:46:04Üyeliği durduruldubu kodun tasarımsal kısmının da burada olduğunu farzedelim
if ($row['pd_image3']) { echo "<img src="$row['pd_image3'] = WEB_ROOT . 'images/product/' . $row['pd_image3'];" />"; } else { //boş bıraktığında tasarım içinde resim falan göstermez ama işte işin tasarımsal kısmı da lazım bunun gibi bir örneğe detaylı yardım verebilmek için } - 04-09-2010, 13:35:21yardımınız için çok teşekkürler ama ne yazık ki bu kod istediğim sonucu vermedi. kodların tamamını atıyorum :izmirden adlı üyeden alıntı: mesajı görüntüle
<?php require_once 'config.php'; /********************************************************* * PRODUCT FUNCTIONS **********************************************************/ /* Get detail information of a product */ function getProductDetail($pdId) { $_SESSION['shoppingReturnUrl'] = $_SERVER['REQUEST_URI']; // get the product information from database $sql = "SELECT pd_name, pd_description, pd_price, pd_image, pd_image2, pd_image3, pd_image4, pd_qty FROM tbl_product WHERE pd_id = $pdId"; $result = dbQuery($sql); $row = dbFetchAssoc($result); extract($row); $row['pd_description'] = nl2br($row['pd_description']); if ($row['pd_image']) { $row['pd_image'] = WEB_ROOT . 'images/product/' . $row['pd_image']; } else { $row['pd_image'] = WEB_ROOT . 'images/no-image-large1.png'; } if ($row['pd_image2']) { $row['pd_image2'] = WEB_ROOT . 'images/product/' . $row['pd_image2']; } else { $row['pd_image2'] = WEB_ROOT . 'images/no-image-large1.png'; } if ($row['pd_image3']) { $row['pd_image3'] = WEB_ROOT . 'images/product/' . $row['pd_image3']; } else { $row['pd_image3'] = WEB_ROOT . 'images/no-image-large1.png'; } if ($row['pd_image4']) { $row['pd_image4'] = WEB_ROOT . 'images/product/' . $row['pd_image4']; } else { $row['pd_image4'] = WEB_ROOT . 'images/no-image-large1.png'; } return $row; } ?> - 04-09-2010, 14:17:31Böyle deneyin bakalım:WarezeBaksana adlı üyeden alıntı: mesajı görüntüle
<?php require_once 'config.php'; /********************************************************* * PRODUCT FUNCTIONS **********************************************************/ /* Get detail information of a product */ function getProductDetail($pdId) { $_SESSION['shoppingReturnUrl'] = $_SERVER['REQUEST_URI']; // get the product information from database $sql = "SELECT pd_name, pd_description, pd_price, pd_image, pd_image2, pd_image3, pd_image4, pd_qty FROM tbl_product WHERE pd_id = $pdId"; $result = dbQuery($sql); $row = dbFetchAssoc($result); extract($row); $row['pd_description'] = nl2br($row['pd_description']); if ($row['pd_image']) { $row['pd_image'] = WEB_ROOT . 'images/product/' . $row['pd_image']; } else { echo ''; } if ($row['pd_image2']) { $row['pd_image2'] = WEB_ROOT . 'images/product/' . $row['pd_image2']; } else { echo ''; } if ($row['pd_image3']) { $row['pd_image3'] = WEB_ROOT . 'images/product/' . $row['pd_image3']; } else { echo ''; } if ($row['pd_image4']) { $row['pd_image4'] = WEB_ROOT . 'images/product/' . $row['pd_image4']; } else { echo ''; } return $row; } ?> - 04-09-2010, 14:21:03Üyeliği durdurulduiyi ama bu şekilde resim olan kısım boş döner ve doğal olarak da ie de resim yeri çirkin dururSoutH adlı üyeden alıntı: mesajı görüntüle
- 04-09-2010, 14:24:46Sadece mantık. Arkadaş tasarımı da yazarsa uydururuz bir şeyler.izmirden adlı üyeden alıntı: mesajı görüntüle
- 04-09-2010, 14:26:31Üyeliği durdurulduburda belirtmiştim boş bırakma mantığınıizmirden adlı üyeden alıntı: mesajı görüntüle
saygılar