Jump to content

Trouble adding a rel=" " to this code:


roldahayes

Recommended Posts

Hi, the code below displays a members images on a page.  When the image is clicked, it opens it in a new page.  I am trying to implement a light box to it instead.

 

I need to add  rel="facebox" to the url somehow....?

 

This is the normal example of how it works in a static page:

 

<a href="images/small-pic1.jpg" rel="facebox"><img src="images/big-pic2.jpg" alt="" width="32" height="32" /></a>

 

 

<?PHP
$img_size =  getimagesize("http://".$_SERVER['SERVER_NAME'] . str_replace($file, '', $_SERVER['PHP_SELF']) . "view_image.php?image_id=". $$n );
      $images .= '<p><a href="./view_image.php?image_id='. $$n . '" ><img class="members_image" src="view_image.php?image_id='. $$n . '"' . imageResize($img_size[0],$img_size[1], 400) .'></a></p>';
    }
  }
?> 

Link to comment
https://forums.phpfreaks.com/topic/187720-trouble-adding-a-rel-to-this-code/
Share on other sites

$img_size =  getimagesize("http://".$_SERVER['SERVER_NAME'] . str_replace($file, '', $_SERVER['PHP_SELF']) . "view_image.php?image_id=". $$n );
      $images .= '<p><a rel="facebox" href="./view_image.php?image_id='. $$n . '" ><img class="members_image" src="view_image.php?image_id='. $$n . '"' . imageResize($img_size[0],$img_size[1], 400) .'></a></p>';
    }
  }

No idea. The question you asked is solved. It's had the rel="facebox" added to it. by the sounds of it your view image php script isn't working and isn't putting out the correct headers, so you're viewing the image file characters instead of the image

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.