简体   繁体   中英

Php code My image is no showing on website

my uploaded image are not showing on webpage.

<div class="col-md-8 news-item">

<a href="<?php echo base_url('home/newsdetail/'); ?><?php echo $newsdetail[0]['id']; ?>" style="text-decoration: none; color:black;" >
        <h1><?php echo $newsdetail[0]['heading']; ?></h1>
    </a>
    <p class="author-name"><?php echo $newsdetail[0]['staffname']; ?> <span class="time"><i class="fa fa-clock-o"></i><?php echo  date("d-m-Y H:i:s",strtotime($newsdetail[0]['created_date'])); ?></span></p>
    <div class="read-img">
    <?php if($newsdetail[0]['image']==''){ ?>
        <img class="img-responsive" src="<?php echo base_url('assets/img/noimage.gif')?>" height="70"/>
        <?php } else { ?>
        <?php $multiimage=explode(",",$newsdetail[0]['image']); ?>
        <div id="jssor_1" style="position:relative;margin:0 auto;top:0px;left:0px;width:980px;height:480px;overflow:hidden;visibility:hidden;">
<!-- Loading Screen -->
<div data-u="loading" class="jssorl-009-spin" style="position:absolute;top:0px;left:0px;width:100%;height:100%;text-align:center;background-color:rgba(0,0,0,0.7);">
    <img style="margin-top:-19px;position:relative;top:50%;width:38px;height:38px;" src="//jssorcdn7.azureedge.net/theme/svg/loading/static-svg/spin.svg" />
</div>
<div data-u="slides" style="cursor:default;position:relative;top:0px;left:0px;width:980px;height:380px;overflow:hidden;">
    <?php foreach($multiimage as $imgrow){ ?>
    <div>
        <img data-u="image" src="<?php echo base_url('uploads/newsimages/'); ?><?php echo $imgrow; ?>" />
        <img data-u="thumb" src="<?php echo base_url('uploads/newsimages/'); ?><?php echo $imgrow; ?>" />
    </div>
    <?php } ?>
    </div>

First, try to print image path array. see if those are correct.

<?php
   $multiimage=explode(",",$newsdetail[0]['image']); 
   print_r($multiimage);
?>

Then make sure those images are in the right directory.

Also for debugging purpos try printing the path if it's ok. you can check the image by simply putting the path on a browser URL. <?php echo base_url('uploads/newsimages/').$imgrow ?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM