-1

我想使用我在数据库中制作的图像参考作为背景:url。我已经完成了设计 => http://i49.tinypic.com/30ihudz.png在我当前的代码中,我使用 div 样式来检索图像,但这并没有显示任何图像。有人可以指导我吗?提前致谢。

公共功能显示产品(){

        $product = $this->db->query("SELECT id, title, description, price, filename FROM trips ORDER BY id");

            while ($row = $product->fetch_assoc())
                        {
                    $output .= '<div class="reisbox">';
                            $output .= '<div id="reis_insidebox1" style="background: url(\'img/content/'.$row['filename'].'\')" width="1000" height="500">';
                    $output .= '<div class="reis_textbox">';
                    $output .= '<h2>'.ucfirst($row['title']).'</h2>';
                            $output .= '<article>';
                            $output .=  ucfirst($row['description']);
                            $output .= '</article>';
                            $output .= '</div>';
                    $output .= '<div class="rightboxx">';
                    $output .= '<div class="reis_price_box">';
                            $output .= '<div class="reis_price_box_text">';
                            $output .= '&euro;'.$row['price'];
                            $output .= '</div>';
                            $output .= '<div class="more_box">';
                            $output .= '<a href="index.php?page=reis.php&pid='.$row['id'].'"><p>Lees meer..</p></a>';
                            $output .= '</div>';
                            $output .= '</div>';
                            $output .= '</div>';
                            $output .='<br />';
                            $output .= '<div id="add">';
                            $output .='<a href="index.php?page=cart.php&action=add&id='.$row['id'].'"><p>Add to cart</p></a>';
                            $output .= '</div>';
                    $output .= '</div>';
                            $output .= '</div>';
                }
                return $output;


    }
4

1 回答 1

0

C:/ 不是 URL,因为它没有协议(如 file: 或 http:)。使路径指向 htdocs 文件夹中的文件,例如

"http://localhost/images/"

管他呢。

于 2013-02-24T15:12:35.757 回答