randomname Posted June 23, 2006 Share Posted June 23, 2006 Well I am new to php so this is probably an easy fix but it is not working for meHere is my code[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 strtolower( substr ( $file, -4, 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);?>[/code]This is the line giving me the problems[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$path = 'site_images/galleries/',$path;[!--colorc--][/span][!--/colorc--]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 doAny help is greatly appreciated I have been messing with this for hoursThanks Quote Link to comment https://forums.phpfreaks.com/topic/12712-relative-directory-reading-not-working/ Share on other sites More sharing options...
zq29 Posted June 23, 2006 Share Posted June 23, 2006 Try replacing the comma with a period.[code]$path = 'site_images/galleries/'.$path;[/code] Quote Link to comment https://forums.phpfreaks.com/topic/12712-relative-directory-reading-not-working/#findComment-48756 Share on other sites More sharing options...
randomname Posted June 24, 2006 Author Share Posted June 24, 2006 Actually right after I posted this I figured it out I used[code]$path = "site_images/galleries/$urlpath";[/code]So this works as wellThanks for the help though Quote Link to comment https://forums.phpfreaks.com/topic/12712-relative-directory-reading-not-working/#findComment-48990 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.