Welcome Guest, Not a member yet? Register   Sign In
List of Images
#11

Parse error: syntax error, unexpected end of file in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\innovationci3\application\views\cms\index.php on line 182
A PHP Error was encountered
Severity: Parsing Error
Message: syntax error, unexpected end of file
Filename: cms/index.php
Line Number: 182
Backtrace:



views/cms/index.php


PHP Code:
<b>Latest Projects:</b><br><br>

<
img src="<?php echo base_url('images/large pic.jpg');?>" width="200px">&nbsp&nbsp<img src="<?php echo base_url();?>images/large pic3.jpg" width="200px">&nbsp&nbsp<img src="<?php echo base_url();?>images/large pic4.jpg" width="200px">&nbsp&nbsp<img src="<?php echo base_url();?>images/large pic5.jpg" width="200px" height="165px">

     
             
 <?php if($images) : ?>
                    <?php foreach ($images as $image) : ?>
                        <?php echo "loop"// do loop ?>
                    <?php endforeach; ?>
              <?php else : ?>
                        <?php echo "no images" // deal with no images found ?>
              <?php endif; ?>
            
           <?php
              foreach 
($images as $image) {
 
          ?>        
                    <li>
                        <span class="zoom">
                            <img  src="http://www.purelineliving.com/public/thumb.php?src=<?php echo $rec->src;?>&w=800&h=800&zc=1">
                        </span>
                    </li>
           <?php
           
}
         
  ?>


<br><br><br>


<!--
<b>Client - client kami antara lain:</b> <div id="proyek">  <b>Proyek masih dalam pengerjaan: </b></div><br>

<img src="images/logo1.jpg"> <img src="images/logo2.jpg">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <img src="images/logo3.jpg"><br>
 
 -->
<br>


</center>

<!-- </div> -->
</body>

<!-- navigation -->
<?php include('footer.php'); ?>
<!-- end of navigation -->

</html> 


line 182 is after </html>

How to fix the error?

Thanks in advance.
" If I looks more intelligence please increase my reputation."
Reply
#12

(This post was last modified: 04-19-2016, 10:03 AM by Wouter60.)

If you include another php file inside your index.php file, you're asking for trouble.
CI allows you to load another view, so I would advise you to do that.

So, in stead of including the footer, do this:
PHP Code:
<?php $this->load->view('footer');?>

CI will load the application/views/footer.php file.
Reply
#13

I already add this:

PHP Code:
<?php $this->load->view('footer');?>

to my last list of codes:


views/cms/index.php


PHP Code:
<html>
<
head>

<
title>Innovation Web Design Jakarta</title>


<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<
meta name="keywords" content="innovation, innovation web, innovation web solution, web design, web developer, web design indonesia, 
web design jakarta, web design company" 
/>
<
meta name="description" content="Web Design Agency" />

<
link href"<?php echo base_url('css/style.css'); ?>" rel="stylesheet" type="text/css" media="screen">
<
script src="<?php echo base_url().'js/jquery.min.js'; ?>" type="text/javascript"></script>
<
script src="<?php echo base_url().'js/chili-1.7.pack.js'; ?>"</script>
<
script src="<?php echo base_url().'js/jquery.cycle.all.js'; ?>" type="text/javascript"></script>
<
script src="<?php echo base_url().'js/jquery.easing.1.3.js'; ?>" type="text/javascript" ></script>

<
style type="text/css">
#slideshow { left: 0; float: left; margin: 0 0 0 50px; z-index: 0;}
#navS { width: 270px; margin: 0 0 0 650px; float: left; position: absolute; z-index: 1;}
#navS li.nav1{ position:relative; float: left; margin: 0 0 0 4px; list-style: none; background: url('images/banner nav1.jpg') no-repeat top; z-index:9;}
#navS li.nav2{ position:relative; float: left; margin: 0 0 0 4px; list-style: none; background: url('images/banner nav2.jpg') no-repeat top; z-index:9;}
#navS li.nav3{ position:relative; float: left; margin: 0 0 0 4px; list-style: none; background: url('images/banner nav3.jpg') no-repeat top; z-index:9;}

#navS a { width: 300px; height: 67px; padding: 3px; display: block; border: 0px solid #ccc;}
#navS li.activeSlide.nav1 a { /* background: #88f */ position: relative; width: 310px; margin: 0 0 0 -18px; background: url('images/banner nav klik1.jpg') no-repeat top; z-index:9;}
#navS li.activeSlide.nav2 a { /* background: #88f */ position: relative; width: 310px; margin: 0 0 0 -18px; background: url('images/banner nav klik2.jpg') no-repeat top; z-index:9;}
#navS li.activeSlide.nav3 a { /* background: #88f */ position: relative; width: 310px; margin: 0 0 0 -18px; background: url('images/banner nav klik3.jpg') no-repeat top; z-index:9;}
#navS a:focus { outline: none;}
#navS img { border: none; display: block;}
pre clearleft }
</
style>
<
script type="text/javascript">
$(
'#slideshow').cycle({ 
    fx:     'fade'
    speed:   900
    timeout10000
    pager:  '#navS'
    pagerAnchorBuilder: function(idxslide) { 
        // return selector string for existing anchor 
        return '#navS li:eq(' idx ') a'
    
});
</
script>
<
script type="text/javascript">

  var _gaq _gaq || [];
  _gaq.push(['_setAccount''UA-35693261-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga document.createElement('script'); ga.type 'text/javascript'ga.async true;
    ga.src = ('https:' == document.location.protocol 'https://ssl' 'http://www') + '.google-analytics.com/ga.js';
    var document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gas);
  })();

</
script>
</
head>

<!-- <
div id="container"> -->
<
center>

<
br>

<
div id="coffee"><img src="images/coffee.jpg" width="130" height="120"></div>


<!-- 
navigation -->
<?
php include('navigation.php'); ?>
<!-- end of navigation -->

<br><br>

<div id="navcontainer">
<div id="demos">
    <div id="slideshow" class="pics">
        <img src="<?php echo base_url('images/banner1.jpg');?>" alt="banner1" width="600" height="200" />
        <img src="<?php echo base_url('images/banner2.jpg');?>" alt="banner2" width="600" height="200" />
        <img src="<?php echo base_url('images/banner3.jpg');?>" alt="banner3" width="600" height="200" />       
    </div>
    <ul id="navS">
        <li class="nav1"><a href="#"></a></li>
        <li class="nav2"><a href="#"></a></li>
        <li class="nav3"><a href="#"></a></li>   
    </ul>
</div>

<div id="bannernavtext">

Web Design & Development<br><br><br><br>
SEO<br><br><br>
Social Media<br><br>

</div>
</div>

<body>
<div id="freequote"><a href="contact.php"><img src="images/request-free-quote.jpg" height="50px"></a></div>

<div id="home-slider">
    <div class="flexslider">
        <ul class="slides">
             <?php foreach($slideshow as $row) : ?>
                <li>
                    <a href="<?php echo $row->href;?>" >
                        <img src="<?php echo $row->images_1;?>" alt="<?php echo $row->h1;?>" />
                    </a>
                </li>
             <?php endforeach; ?>
        </ul>
    </div>
</div>


<?php echo $content;?>


<div id="article">
<b>Tentang Innovation</b><br><br>

Innovation adalah sebuah web agency di Jakarta yang bergerak dalam jasa pembuatan website. Kami membuat website sesuai dengan pesanan client kami (Statis, CMS, Ecommerce, ataupun Custom). 
Sebelum kami memprogram website anda, kami mendesignnya terlebih dahulu, setelah design tersebut mendapat persetujuan dari anda baru kami jadikan website 
yang berfungsi untuk menarik pengunjung.  Melalui website anda dapat memperkenalkan perusahaan anda ataupun memasarkan produk anda melalui internet, yang tentunya akan 
meningkatkan penjualan anda.  <br><br>


Selain itu kami juga menerima design Marketing tools dan Coorporate Identity seperti flyers, brosur, spanduk, backdrop, kartu nama, kop surat, amplop, logo dan stempel.
Silahkan lihat portfolio kami supaya anda mendapatkan gambaran hasil design yang pernah kami buat.<br><br> 

<b>Latest Projects:</b><br><br>

<img src="<?php echo base_url('images/large_pic.jpg');?>" width="200px">&nbsp&nbsp<img src="<?php echo base_url();?>images/large_pic3.jpg" width="200px">&nbsp&nbsp<img src="<?php echo base_url();?>images/large_pic4.jpg" width="200px">&nbsp&nbsp<img src="<?php echo base_url();?>images/large_pic5.jpg" width="200px" height="165px">

     
            <?php if(isset($images)) : ?>
                <?php foreach ($images as $image) : ?>
                    <?php 
                    
//do whatever you need with each image
                    echo "images";
                ?>
                <?php //endforeach; ?>
                
            <?php else : ?>
                    <?php
                    
// determine what to do if there are no images
                    echo "else images";
            ?>
            <?php endif; ?>
            
            <?php
                foreach 
($images as $image) :
            ?>        
                   <!-- <li>
                        <span class="zoom">
                            <img  src="http://www.purelineliving.com/public/thumb.php?src=<?php echo $rec->src;?>&w=800&h=800&zc=1">
                        </span>
                    </li> -->
                    <?php echo "images"?>
            <?php
                
//endforeach; 
            ?>


<br><br><br>


<!--
<b>Client - client kami antara lain:</b> <div id="proyek">  <b>Proyek masih dalam pengerjaan: </b></div><br>

<img src="images/logo1.jpg"> <img src="images/logo2.jpg">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <img src="images/logo3.jpg"><br>
 
 -->
<br>


</center>

<!-- </div> -->
</body>

<!-- navigation -->
<?php $this->load->view('footer');?>
<!-- end of navigation -->

</html> 


And still have this error message:

Parse error: syntax error, unexpected 'else' (T_ELSE) in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\innovationci3\application\views\cms\index.php on line 147
A PHP Error was encountered
Severity: Parsing Error
Message: syntax error, unexpected 'else' (T_ELSE)
Filename: cms/index.php
Line Number: 147
Backtrace:


Line 147 is  <?php else : ?>

What should I do to fix the error ?
" If I looks more intelligence please increase my reputation."
Reply
#14

Look at line 145 (?):
PHP Code:
<?php //endforeach; ?>

The // make the php instruction do .... exactly nothing!
So, your script is looking for the end of a foreach loop, but instead it finds an endif.
Remove the // in front of endforeach to solve this.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB