Hi,

I am using an include function to include image gallery to my site.

this is index.html of image gallery:

<link rel="stylesheet" type="text/css" href="css/sliderkit-core.css" media="screen, projection" />  

<link rel="stylesheet" type="text/css" href="css/sliderkit-demos.css" media="screen, projection" />  

<link rel="stylesheet" href="css/main.css" type="text/css" />  

<!--[if IE 6]>  

<link rel="stylesheet" type="text/css" href="css/sliderkit-demos-ie6.css" />  

<![endif]--> 

<!--[if IE 7]>  
<![endif]--> 

<link rel="stylesheet" type="text/css" href="css/sliderkit-demos-ie7.css" />  

<!--[if IE 8]>  

<link rel="stylesheet" type="text/css" href="css/sliderkit-demos-ie8.css" />  

<![endif]--> 

   

<script src="js/jquery-1.5.2.min.js"></script>  

<script type="text/javascript" src="js/jquery.sliderkit.1.5.1.pack.js"></script>  

<script type="text/javascript" src="js/jquery.easing.1.3.min.js"></script>  

<script type="text/javascript" src="js/jquery.mousewheel.min.js"></script>  

<script type="text/javascript" src="js/main.js"></script>  
   

<div class="example">  

    <!-- <h3><a href="#">Slider Kit example</a></h3> --> 

   

    <div class="sliderkit photosgallery-std" id="sliderkit_galery">  

        <div class="sliderkit-nav">  

            <div class="sliderkit-nav-clip">  

                <ul></ul>  

            </div>  

           <div class="sliderkit-btn sliderkit-nav-btn sliderkit-nav-prev"><a rel="nofollow" href="#" title="Previous line"><span>Previous line</span></a></div>  

            <div class="sliderkit-btn sliderkit-nav-btn sliderkit-nav-next"><a rel="nofollow" href="#" title="Next line"><span>Next line</span></a></div>  

            <div class="sliderkit-btn sliderkit-go-btn sliderkit-go-prev"><a rel="nofollow" href="#" title="Previous photo"><span>Previous photo</span></a></div>  

            <div class="sliderkit-btn sliderkit-go-btn sliderkit-go-next"><a rel="nofollow" href="#" title="Next photo"><span>Next photo</span></a></div>  

        </div>  

        <div class="sliderkit-panels">  

            <div class="sliderkit-btn sliderkit-go-btn sliderkit-go-prev"><a rel="nofollow" href="#" title="Previous"><span>Previous</span></a></div>  

            <div class="sliderkit-btn sliderkit-go-btn sliderkit-go-next"><a rel="nofollow" href="#" title="Next"><span>Next</span></a></div>  

        </div>  

    </div>  

</div>

When I use include function:

image_gallery.php

<div id="content">
      
      <?php 
	  
	  include('includes/koneksi.php');
	  
	  include('gallery/index.html');  

			 
      ?>

When I run it and check the output in my site image_gallery.php:

Previous line
Next line
Previous photo
Next photo
Previous
Next

That's the output. Why is it? It suppose to create a nice-looking image gallery if I check it from the image gallery folder.

Is it because of the include function ?

Recommended Answers

All 5 Replies

include('gallery/index.html');
what is this supposed to do?

My guess is that it cannot find the referenced CSS files. Also, the <link> tags only function correctly when they are in the <head> section of your page.

Do you think I cannot use include in this case?

In other case, I use include and the css is still link to the page (eventhough not as many as this one).

there are too many css link. That's why I am trying to use include to simplify the code.

include('gallery/index.html');

basically is linking index.html codes and extract it (run it) in image_gallery.php.

Oh.. I just tried to place <link> tags inside <head> section but it does not work yet. The gallery/index.html does work if I run in by itself but not as an include function.

Do you think I cannot use include in this case?

In other case, I use include and the css is still link to the page (eventhough not as many as this one).

there are too many css link. That's why I am trying to use include to simplify the code.

include('gallery/index.html');

basically is linking index.html codes and extract it (run it) in image_gallery.php.

Oh.. I just tried to place <link> tags inside <head> section but it does not work yet. The gallery/index.html does work if I run in by itself but not as an include function.

if the problem is what pritaeas described then go ahead and include them in head tag

<html>
<head>
<?php include (....); ?>
<head>
......

I modify the script and file structure. Now I have some errors:

meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Masterlink International</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="includes/navstyle.css" />

<link rel="stylesheet" type="text/css" href="gallery/css/sliderkit-core.css" media="screen, projection" />
<link rel="stylesheet" type="text/css" href="gallery/css/sliderkit-demos.css" media="screen, projection" />  
<link rel="stylesheet" href="gallery/css/main.css" type="text/css" />  
<link rel="stylesheet" type="text/css" href="gallery/css/sliderkit-demos-ie7.css" />  

<script src="gallery/js/jquery-1.5.2.min.js"></script>  
<script type="text/javascript" src="gallery/js/jquery.sliderkit.1.5.1.pack.js"></script>  
<script type="text/javascript" src="gallery/js/jquery.easing.1.3.min.js"></script>  
<script type="text/javascript" src="gallery/js/jquery.mousewheel.min.js"></script>  
<script type="text/javascript" src="gallery/js/main.js"></script>

<script type="text/javascript" src="includes/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="includes/superfish.js"></script>
<script type="text/javascript">
jQuery(function(){
	jQuery('ul.menu').superfish({
		animation: {opacity:'show',height:'show'},
		speed: 'slow', 
		autoArrows: true
	});
});
</script>

All the href="filename" are underline green. If I place cussor on top of it, it says: Found 1 error in external css file.

but I do not know what type of error is it and how to fix it? I basically do not see the picture and thumbnail in the gallery.

By the way, I am taking the gallery script from here: http://www.script-tutorials.com/how-to-create-photo-gallery-using-slider-kit-jquery/.

I also have been using firebug.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.