I am working with a template and want to get my images from a url not on my site can i do it from this code? function getProductDetail($pdId, $catId) { $_SESSION['shoppingReturnUrl'] = $_SERVER['REQUEST_URI']; // get the product information from database $sql = "SELECT pd_name, pd_description, pd_price, pd_image, pd_qty, pd_affurl 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-large.png'; } $row['cart_url'] = "cart.php?action=add&p=$pdId"; return $row; } Thanks for your help!
yes, just replace with the url and dir of where the images are located, like so: if ($row['pd_image']) { $row['pd_image'] = 'http://www.mydomainname.com/images/product/' . $row['pd_image']; } else { $row['pd_image'] = 'http://www.mydomainname.com/images/no-image-large.png'; } Code (markup): of course, you have to make sure that the images have the same name as on the database.
this is what I put in if ($row['pd_image']) { $row['pd_image'] = 'http://www.evitamins.com/images/products/' . $row['pd_image']; } else { $row['pd_image'] = 'http://www.evitamins.com/images/no-image-large.gif'; }
if ($row['pd_image']) { $row['pd_image'] = 'http\://www.mydomainname.com/images/product/' . $row['pd_image']; } else { $row['pd_image'] = 'http\://www.mydomainname.com/images/no-image-large.png'; } Code (markup): try that.