A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: relative directory reading not working

  1. #1

    relative directory reading not working

    Well I am new to php so this is probably an easy fix but it is not working for me

    Here is my code

    PHP Code:
    <?php
    $path 
    $_GET['path'];
    $path 'site_images/galleries/',$path;
    if (!
    $path or !is_dir($path)) $path='mp3';
    $dir_handle opendir($path) or die("Unable to open $path");
    $files=array();
    while (
    $file readdir($dir_handle)) 
    {
        if (
    $file != '.' and $file != '..' and strtolowersubstr $file, -4) ) == ".jpg" )
        
    $files[]=$file;
    }
    $i=0;

    if(
    count($files)) {
        
    sort ($files);
        foreach (
    $files as $file) {
    $i++;
            list( 
    $w$h ) = GetImageSize$path '/' $file );
            echo 
    '&image',$i,'='$file,'&img_w',$i,'='$w,'&img_h',$i,'='$h;
        }
    }
    closedir($dir_handle);
    ?>
    This is the line giving me the problems
    $path = 'site_images/galleries/',$path;

    I want to use the $_GET as the directory within "site_images/galleries/" but this isn't working for me if I take out that line it works great but I have to put path=site_images/galleries/gallery1 which I don't want to do

    Any help is greatly appreciated I have been messing with this for hours

    Thanks

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    seems you have typed a , (comma) instead of a . (period) ....

    Musicman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center