Re: how to create a gallery without using the EXIF function?



Message-ID: <i015o1d4ev501ijadrb4s5ptdg3d233j9m@xxxxxxx> from FayeC
contained the following:

>I need to create a code that will pull out 4 images from a folder that
>will have the same username as the user's login.
>After login the user is taken to a page that will contain the 4 images
>in the folder arranged in a table or div.


I started work on something similar last night.
http://www.ckdog.co.uk/jladder/files.php
It crudely shows .jpgs in a directory as thumbnails (simple browser
resizing). I've still got quite a bit to do, but it may be useful.


<HTML>
<HEAD>
<TITLE>File management</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">


<table align="center" border="1" cellspacing="0" cellpadding="2">
<?php

//$dir = $path."";
$path=$_SERVER['PATH_TRANSLATED'];
//print "$path<br>";
$i= strlen($path);
//print"$i<br>";
do{$i--;}
while(strpos($path,"/",$i)===false);
//print"$i<br>";
//print substr($path,0,$i);
$path=substr($path,0,$i+1);
$dir=$path;

// Open a known directory, and proceed to read its contents
//if (is_dir($dir)) {
$width=100;
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
//print $dir . $file;
if($file!="." && $file!=".." &&
strtolower(substr($file,-3))=="jpg"){

$size = getimagesize($file);

$height=($size[1]*$width)/$size[0];
echo "<tr><td><img src='$file'width='$width'
height='$height'></td><td><b> <a
href=\"$file\">$file</a></b></td></tr>\n";
}
}
closedir($dh);
}
//}
?>


</table>
</form>
</BODY>
</HTML>

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
.



Relevant Pages

  • Re: Login control and restricted member pages
    ... As you said the login dialog prompts each time the page loading a image, ... protected folder. ... When a page display some images file, ... NTFS permission limitation. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Login control and restricted member pages
    ... As you said the login dialog prompts each time the page loading a image, ... protected folder. ... When a page display some images file, ... the root members folder isn't. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Is it possible to do Authentication with ASP.NET / C# over IIS ?
    ... I try to solve a problem: Some folder on an IIS Webserver should be ... But I want to have a SQL ... database with the users which are allowed to login and just ONE System ... Make a login page and check Username and password against the entries ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How do I retrieve images dynamically based on the login username?
    ... FayeC wrote: ... users are provided with username and password by the admin). ... The users are supposed to login to a specific page where they can see 4 images. ...
    (comp.lang.php)
  • Re: Reading from txt file
    ... The login is a simple login using POST and the page receiving the POST ... data is a page where images are displayed. ... And then parsing the "familyname" out of the file. ... The problem is that I was able to parse the username out of the txt ...
    (comp.lang.php)