[nycphp-talk] foreach ERROR
lists at jack-scott.com
lists at jack-scott.com
Mon Jul 17 16:18:29 EDT 2006
can you post the errors?
On Mon, 2006-07-17 at 16:12 -0400, CED wrote:
> Yep errors even with a full path.
>
> ----- Original Message -----
> From: "Baer, Jon" <jbaer at VillageVoice.com>
> To: "NYPHP Talk" <talk at lists.nyphp.org>
> Sent: Monday, July 17, 2006 3:58 PM
> Subject: Re: [nycphp-talk] foreach ERROR
>
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Does it bail out even w/ an absolute path? Ie: $sFolder =
> '/full/path/to/Audio/Music'
>
> The directory change in ".." might be a security issue.
>
> - - Jon
>
> - -----Original Message-----
> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
> On Behalf Of CED
> Sent: Monday, July 17, 2006 3:43 PM
> To: NYPHP Talk
> Subject: [nycphp-talk] foreach ERROR
>
> Sirs,
>
> I have used variables many times in foreach statements... and having
> spent several hours tryignt o debug this I thought I'd throw it out
> here:
>
>
> 1. <?
> 2. function readD($dir){
> 3. if(!$dir){$dir = '.';}
> 4. foreach(glob("$dir/*.mp3") as $item){$sort[]=
> end(explode('/',$item));}
> 5. foreach($sort as $sorteditem){
> 6. if($sort){natsort($sort);}
> 7. foreach($sort as $item){$return[]= $item;}
> 8. if(!$return){return array();}
> 9. }
> 10. return $return;
> 11. } ?>
> 12. <?php header("Content-type: text/xyxml") ?>
> 13. <? echo(' <?xml version="1.0" encoding="UTF-8"?> ') ; ?>
> 14. <? echo '<player showDisplay="yes" showPlaylist="no"
> autoStart="yes">
> 15. ' ;
> 16.
> 17. $sFolder = '../Audio/Music' ;
> 18. foreach(readD($sFolder) as $item)
> 19. {
>
> PHP keeps erroring on Lines 5 and 18. Any thoughts? Is this a bug? Am I
> a moron?
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (MingW32)
>
> iD8DBQFEu+vv99e5DI8C/rsRAhdMAJ9U3IDKMrjOmLZaUbhApdH1kbf/EwCfdEpi
> jS9ybm9I+DA+rftW3SS80Q8=
> =Ipnj
> -----END PGP SIGNATURE-----
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>
>
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20060717/4f3528c1/attachment.html>
More information about the talk
mailing list