Im trying to use two includes in my HTML documents, the first one being a website gallery and the 2nd one being a logo gallery. I have made two separate PHP files websites.php
and logos.php. I have setup my .htaccess file already and i know it is working. the problem is when i put in i can't get my second include to show up.
index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Mirror Designs</title>
<link href="styles.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="gallery/style.css" />
<link rel="stylesheet" type="text/css" href="gallery/resources/fancy.css" />
<script type="text/javascript" src="gallery/js/jquery-1.2.3.pack.js"></script>
<script type="text/javascript" src="gallery/js/jquery.fancybox-1.0.0.js"></script>
<script type="text/javascript">
$(function(){
$(".photo-link").fancybox({ 'zoomSpeedIn': 500, 'zoomSpeedOut': 500, 'overlayShow': true });
});
</script>
</head>
<body id="body">
<?php include("functions/galleryfunctions.php") ?>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" id="heading-table1">
<tr>
<td height="261" align="center" valign="top" bgcolor="#4A4A4A"><img src="images/logo.jpg" width="1203" height="197" alt="Mirror Designs"/></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="nav" id="heading-table2">
<tr>
<td width="9%" align="center" bgcolor="#999999">WEBSITES</td>
<td width="6%" align="center" bgcolor="#999999">LOGOS</td>
<td width="6%" align="center" bgcolor="#999999">OTHER</td>
<td width="59%" align="center">WE ARE MIRROR DESIGNS - WE MAKE SIMPLE, CLEAN AND EFFECTIVE WEBSITES</td>
<td width="20%" align="center" bgcolor="#999999">Contact Us</td>
</tr>
</table>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td height="654" valign="top"><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" id="maintable-location">
<tr>
<td width="0%" height="30" align="left"> </td>
<td width="97%" height="50" align="left"><h1>Our Websites</h1></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?php require_once("includes/websites.php"); ?></td>
</tr>
</table><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td width="0%" height="30" align="left"> </td>
<td width="97%" height="50" align="left"><h1>Our Logos</h1></td>
</tr>
</table><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?php require("includes/logos.php"); ?></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
/functions/gallerfunctions.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<?php
$variable_name = '';
function createThumb_square($source,$dest) {
$thumb_size = 100;
$size = getimagesize($source);
$width = $size[0];
$height = $size[1];
if($width> $height) {
$x = ceil(($width - $height) / 2 );
$width = $height;
} elseif($height> $width) {
$y = ceil(($height - $width) / 2);
$height = $width;
}
$new_im = ImageCreatetruecolor($thumb_size,$thumb_size);
$im = imagecreatefromjpeg($source);
imagecopyresampled($new_im,$im,0,0,$x,$y,$thumb_size,$thumb_size,$width,$height);
imagejpeg($new_im,$dest,100);
}
function fileExists($dir, $file)
{
if ($handle = opendir($dir)) {
while (false !== ($file_name = readdir($handle))) {
if($file_name == $file){
return true;
}
}
return false;
}
}
?>
<body>
</body>
</html>
includes/websites.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="gallery/style.css" />
<link rel="stylesheet" type="text/css" href="gallery/resources/fancy.css" />
</head>
<?php
/* settings */
$image_dir = 'gallery/websites/';
$per_column = 5;
/* step one: read directory, make array of files */
if ($handle = opendir($image_dir)) {
while (false !== ($file = readdir($handle)))
{
if ($file != '.' && $file != '..')
{
$file_thumb = createThumbName($file,'.jpg','-thumb');
if(strstr($file,'-thumb'))
{
$files[] = $file;
}elseif (!fileExists($image_dir,$file_thumb))
{
echo 'reingelaufen';
// echo 'neuer Thumbname ist:'.” “.$file_thumb;
createThumb_square($image_dir.$file,$image_dir.$file_thumb);
}
}
}
closedir($handle);
}
/* step two: loop through, format gallery */
sort($files);
if(count($files))
{
foreach($files as $file)
{
$count++;
echo '<a class="photo-link" rel="one-big-group" href="',$image_dir,str_replace('-thumb','',$file),'"><img src="',$image_dir,$file,'" width="100" height="100" /></a>';
if($count % $per_column == 0) { echo '<div class="clear"></div>'; }
}
}
else
{
echo '<p>There are no images in this gallery.</p>';
}
?>
<body>
</body>
</html>
includes/logos.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<?php
/* settings */
$image_dir = 'gallery/logos/';
$per_column = 5;
/* step one: read directory, make array of files */
if ($handle = opendir($image_dir)) {
while (false !== ($file = readdir($handle)))
{
if ($file != '.' && $file != '..')
{
$file_thumb = createThumbName($file,'.jpg','-thumb');
if(strstr($file,'-thumb'))
{
$files[] = $file;
}elseif (!fileExists($image_dir,$file_thumb))
{
echo 'reingelaufen';
// echo 'neuer Thumbname ist:'.” “.$file_thumb;
createThumb_square($image_dir.$file,$image_dir.$file_thumb);
}
}
}
closedir($handle);
}
/* step two: loop through, format gallery */
sort($files);
if(count($files))
{
foreach($files as $file)
{
$count++;
echo '<a class="photo-link" rel="one-big-group" href="',$image_dir,str_replace('-thumb','',$file),'"><img src="',$image_dir,$file,'" width="100" height="100" /></a>';
if($count % $per_column == 0) { echo '<div class="clear"></div>'; }
}
}
else
{
echo '<p>There are no images in this gallery.</p>';
}
?>
<body>
</body>
</html>
this is allowing me to see the images in each folder however, the formatting is way off? can any of you see what I am doing wrong? Or Maybe I have to redo the whole thing and you all are gunna laff at me? but please be nice, i am brandy new at this...