Hello all,
I had tried to read through the first say 10 pages of searches on php
for a solution and tried everything that was offered and I am still
coming up dry. First off I can get fancybox to work perfect when it is
pointed to a regular image. I have a client that would like a certain
background behind that image and thus I am trying to open that image
in a php script of a page. I have tried passing the object id and re-
pulling information from mysql or just sending the file names directly
to the page. When i open the page by itself it opens perfect in a
browers but will either show "The requested content cannot be loaded.
Please try again later." or a long thing white box with no image until
I click out of it and on it again then it will open. It seems that
when I try to set the type to image it says it cannot be found. though
the images are png files???
You can see it here:
http://derbyskulz.leonegraphics.com/portfolia.php
and this is what should be loading in fancy
http://derbyskulz.leonegraphics.com/portimage.php?id=1
I have tried changing the type to image:
<script type="text/javascript" src="includes/fancybox/
jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="includes/fancybox/
jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" href="includes/fancybox/
jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
<script type="text/javascript">
$(document).ready(function() {
$("a.grouped_elements").fancybox({'type' : 'image'});
});
</script>
and tried changing the php page all around and nothing seems to work:
code from main page:
while ($row = mysql_fetch_array ($result)){
?>
<div class="productbox" align="center">
<a class="grouped_elements" href="portimage.php?id=<?PHP echo
$row['id']; ?>"><img style="background:url(thumb/<?PHP echo
$row['backImage']; ?>) no-repeat;" border="0" src="thumb/<?PHP echo
$row['image']; ?>" /></a>
</div>
<?PHP
//ending for loop for products on a page
}
PHP page:
<?PHP
include 'includes/dbconnect.php';
$id = $_GET['id'];
$query = "SELECT * FROM portfolio
WHERE active = '1'
AND id = '$id'";
$result= mysql_query($query);
while ($row = mysql_fetch_array ($result)){
$back = $row['backImage'];
$image = $row['image'];
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="image/png"/>
</head>
<body style="margin:0px 0px 0px 0px;">
<img style="background:url(large/<?PHP echo $back; ?>) no-repeat;"
src="large/<?PHP echo $image; ?>">
</body>
</html>