Re: [PHP] Having an issue with a Directory Listing in the php Scripting

2002-08-09 Thread §§ Duncan MacLeod §§

it seems as though this wold work great if I had the script running in a
actual php.. the initial file is index.php but calls to indexcontent.inc
that calls to another inc file that has the actual content info in it.
maybe it would help if put a copy of the inc file and a copy of the php
files.. ?? anyhow if anyone else cares to help it would be great unless the
original Daniel would like to try this one out.. lol.. let me know it is
greatly appreciated.

§§ Duncan MacLeod §§

"Analysis & Solutions" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Fri, Aug 09, 2002 at 08:58:41AM -0500, §§ Duncan MacLeod §§ wrote:
> > I am only being able to list the first
> > file in each of the directories.  Not the entire directory.
> ...  snip  ...
>
> > Although, the only files I really need out of the
> > directory are going to be '.JPG', '.jpg', '.GIF', '.gif', '.JPEG',
'.jpeg'.
>
> While this doesn't do exactly what your script does, it will point you in
> the right direction...
>
> 
> $DirHandle=opendir('.');
>
> while ($FileName = readdir($DirHandle)) {
>switch ( substr($FileName, -4) ) {
>   case '.jpg':
>   case '.JPG':
>   case 'jpeg':
>   case 'JPEG':
>   case '.gif':
>   case '.GIF':
>  $FileList[] = $FileName;
>  break;
>}
> }
>
> # Sort the list alphabetically:
> asort($FileList);
>
> echo '';
> while (list(,$Name) = each($FileList) ) {
>echo "$Name\n";
> }
> echo '';
>
> ?>
>
> --
>PHP classes that make web design easier
> SQL Solution  |   Layout Solution   |  Form Solution
> sqlsolution.info  | layoutsolution.info |  formsolution.info
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409


begin 666 my_inc_files.zip
M4$L#!!0``@`(`/M^"2W97?3\4D-58D
ME4$):)RA7C-\J*
M:QD7&-2)..]U!T9;-8C42!:Q-5LZ"0&?JU\+C1F;2P$V]S?67Z29-3]O3I+-
M7PXVXS24,[U-/S9D=#-WM0*O=YTVTYG:WQQ+G.Z&>0E+Z/M(HC,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;Y=;L
MDX=F0PE8'2$UKB=H5N=0)>7?,]C1'Z N$^L6:1'&)U4$Q]1Y_1T'3YWIQ&XZS
M2&.W]>9-<_\6'^"6DP0K32Q^=RO+/4YYR5MDUN\H1VF15/ZX* !7&0A.B26<
MEP>B1_7)VD<7L54$+%*/E LJC/A0B4U:XV5U+%"O(\)SQ4I%X"&Y]^9=E %5
MP661)A.W.P8@X?$\UDQCWBT&MNJ4>4MUT9#<>#K'?_&R$@,%@=O):[?3\7*7
MV]&7]]!X"Q F]WH/HK3%04"[//_K/CN+.CM YC)4EGOHFL'[#/B2GB;IR&L#
MG,-?6J]:KYN+PGTYZ5YTZ6RD6"8)5Z?#^4/4Q:>+X^Z%>/_3(A*H3):N`JTI
MS1I#H4B)JWOVNS=8HOLC8'"IB@\`:,@ZQ=#+@#874B;K@PX"(ZP$)P@!^/K_C(X
M5:$DZ#0Y02BWV118MI;.\'N5H/_V=RL`O-X`LAS U?;PE\0Z`#\D0JQI0SIO
MFD,AR;@EL",3B5)1E6#=4R*%A]BW0VU
ML"]!E1A[OS N*\$)KK"P$;D%?XEG]G56\>3[XPVU&1CHW=J6:,/9?
M8>2^0OBD;#D;I_*;<3%%'12K%7ST>/!K.-E]OEV&.K>30;1*)^]I6!P_IA?:
M\=SEY?E:^5>JD]6L_ VCWXH3U%U7#\>T$1> N55O(+\L&A/X'[
M@2<'?R\4)K:"LY2*#/]?_) 0(_A9O5RJ1",97G)ZH-_ERY',K-2$XC*-(XUT
MWPK.E30H4(,F4_9G@<1S.?"X@EZMT- 1W[#Q5,V?IP%/YWRBIIO^@
MELHSQH>R\+$_+5J:C9^BM==/5=I/I)8ELCPBQ$QB2Y4/C!XG:M5"]X5AQ"7#
M_!:%R(M8F8=EN""0W[ (1MVLX/Q2W?Q7&>Z!X0_W&>X]PK&

[PHP] Having an issue with a Directory Listing in the php Scripting

2002-08-09 Thread §§ Duncan MacLeod §§

I was wondering if I could get alittle help in this issue.  I have
extinguished all other resources, with no avail to help.  I am trying to get
a directory listing for a dropdown list to choose for connection to a MySQL
database for the correct image name to be printed into the database.  I have
the database part working perfectly as far as the printing the correct name
from the directory list, although I am only being able to list the first
file in each of the directories.  Not the entire directory.  This is in a
.inc script running with two other scripts a .php script and another .inc
script for the reference to the following.  I was wondering if someone could
give me some insight as to how I could resolve this issue to make the list
actually appear like it is supposed to displaying everything in the list
that has the extension '.jpg', '.JPG', '.gif', '.GIF', '.bmp', '.BMP',
'.jpeg', '.JPEG'.  Although, the only files I really need out of the
directory are going to be '.JPG', '.jpg', '.GIF', '.gif', '.JPEG', '.jpeg'.
some assistance would be greatly appreciated.. the following is the actual
script as I have written it.

/* The Script segment that is needed to be fixed or working

*/
if ($dir1 = opendir("../../members_profiles/pics/")) {

while(FALSE !== ($file = readdir($dir1))) {

if ($file != "." && $file != "..") {

$fdd["picture"] = Array(

'name'=>'Picture',

'select'=>'D',

'type'=>'string',

'maxlen'=>130,

'nowrap'=>false,

'values'=>Array($file),

'default'=>'no_image.jpg',

'required'=>true,

'sort'=>true

);

}

}

closedir($dir1);

}

if ($dir2 = opendir("../../members_profiles/crests/")) {

while(FALSE !== ($files = readdir($dir2))) {

if ($files != "." && $files != "..") {

$fdd["crest"] = Array(

'name'=>'Crest',

'select'=>'D',

'type'=>'string',

'maxlen'=>130,

'nowrap'=>false,

'values'=>Array($files),

'default'=>'no_image.jpg',

'required'=>true,

'sort'=>true

);

}

}

closedir($dir2);

}

/*

 the web page that this is running on is
http://www.dragonpalace.net/~dfwshinai/members_profiles although, the script
is actually resident in the admin pages of this site. */

Thanks in advance
§§ Duncan MacLeod §§



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php