Jump to content
xisto Community
Sign in to follow this  
OwrLam

Help With Script Help please

Recommended Posts

I make script of images galery:

<?php$title="Galery";$head=$html="";$Find_Img_name=0;$Dir="./img/galery/";$OpenDir=opendir($Dir);while(($File=readdir($OpenDir))!==false){if($File!="." && $File!=".."){if(md5($File)==$_GET['id']){$Find_Img_name=$File;break;}}}$Img="data/images.dat";$ImgFile=file($Img);$Yes_Print=0;for($i=0;$i<count($ImgFile);$i++){$ImgSPL=split("::",trim($ImgFile[$i]));$Img_src=$ImgSPL[0];$Img_name=$ImgSPL[1];if($Img_src==$Find_Img_name){$Yes_Print=1;break;}}if($Find_Img_name && $Yes_Print){$Image_size=filesize("$Dir$Find_Img_name");$html.=<<<HTML<table align=center border=0 style="border:1px Solid #8994B1"><tr><td align=center><img src="$Dir$Find_Img_name" alt="$Find_Img_name ($Image_size bytes)" border=0><br></td></tr><tr><td align=center><b>$Img_name</b></td></tr></table>HTML;}else{echo "<font color=Red><b>Error!";exit;}include "inc/_small.php";?>

But he doesnt work! Error is - can`t get image size!

Share this post


Link to post
Share on other sites

make sure that you are comparing the id to the md5 checksum of the image.

or try changing...

$Image_size=filesize("$Dir$Find_Img_name");

to...

$Image_size=filesize($Dir . $Find_Img_name);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.