Jump to content

LIGHTBOX PROBLEM!


phpwannabe25

Recommended Posts

Hi,

 

I am calling photos from my database, which is no problem....

the code for which is below:

 

<div id="hotelphotos">

<?php

$hotelident = $_GET["id"];

$con = mysql_connect("dbdetails","dbdetails","db details");

if (!$con)

{

die('Could not connect: ' . mysql_error());

}

mysql_select_db("db details", $con);

$result = mysql_query("SELECT * FROM signuphotel

WHERE id = '$hotelident'

");

while($row = mysql_fetch_array($result))

{

Echo "<tr><td align='center'><img src=http://www.mywebsite.com/images/".$row['photo2'] ." alt='photo2'  border='1' height='160' width='171'></td><tr>";

 

}

mysql_close($con);

?>

</div>

 

 

This is working fine!

 

Now, im attempting to introduce a light box effect in to the page.

 

I've added the lightbox.js and the mootools.js scrtips and putt the path to the head.

 

The code i've used for the photos has now changed to the following:

The result is nothing, just a blank screen....clearly i am goin majoryly wrong somewhere, however could anyone point me in the right direction in gettin from the code above to havin the lightbox ipmlemented in conjunction with the database fed photos.

 

<div id="hotelphotos">

<?php

$hotelident = $_GET["id"];

$con = mysql_connect("dbdetails","dbdetails","dbdetails");

if (!$con)

{

die('Could not connect: ' . mysql_error());

}

mysql_select_db("db details", $con);

$result = mysql_query("SELECT * FROM signuphotel

WHERE id = '$hotelident'

");

while($row = mysql_fetch_array($result))

{

Echo "<tr><td align='center'><a href=".$row['photo1'] ." rel="lightbox[mando]" id="image1" title="image 1">"<img src=http://www.mywebsite/images/".$row['photo1'] ." alt='photo1'  border='1' height='160' width='171' /></a></td><tr>";

echo "<tr><td>      </td></tr>";

 

 

}

mysql_close($con);

?>

 

<script type="text/javascript">

window.addEvent('domready',function(){

Lightbox.init({descriptions: '.lightboxDesc', showControls: true});

});

</script>

 

 

</div>

 

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/172708-lightbox-problem/
Share on other sites

Echo "<tr><td align='center'><a href=\"http://www.mywebsite/images/".$row['photo1'] ."\" rel=\"lightbox[mando]\" id=\"image1\" title=\"image 1\"><img src=\"http://www.mywebsite/images/".$row['photo1'] ."\" alt='photo1'  border='1' height='160' width='171' /></a></td><tr>";

Link to comment
https://forums.phpfreaks.com/topic/172708-lightbox-problem/#findComment-910368
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.