garevn Posted September 22, 2012 Share Posted September 22, 2012 Hello i want to display in my local site a hard drive path like"C:\Program Files (x86)"Is there any chance? Link to comment Share on other sites More sharing options...
niche Posted September 22, 2012 Share Posted September 22, 2012 http://www.w3schools.com/php/func_directory_opendir.asp Link to comment Share on other sites More sharing options...
garevn Posted September 22, 2012 Author Share Posted September 22, 2012 i tried both codes but the browser load and load all time and nothing happen.. <?php//Open images directory$dir = opendir("pics");//List files in images directorywhile (($file = readdir($dir)) !== false) { echo "filename: " . $file . "<br />"; }closedir($dir);?> Link to comment Share on other sites More sharing options...
Don E Posted September 22, 2012 Share Posted September 22, 2012 Do you have a directory called "pics" with images/files inside it? Link to comment Share on other sites More sharing options...
garevn Posted September 22, 2012 Author Share Posted September 22, 2012 yes i have pics. An other guy helped me and i tried this <?php$f = glob("c:/Program Files (x86)/*.*");foreach ($f as $file)echo "$file \n";?> It works fine but i was thinking about results in items i may click on them, Is there any chance? Link to comment Share on other sites More sharing options...
niche Posted September 22, 2012 Share Posted September 22, 2012 (edited) Just put a line in your while loop that echos the images as an anchor. Edit That will give you the main idea so you can focus on making it pretty. Edited September 22, 2012 by niche Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now