Miko Posted November 18, 2009 Share Posted November 18, 2009 Hello, I'm encountering a problem with this script: $depot = $explode[0]; $date = $explode[1]; $tournr = $explode[2]; $open = opendir("http://serveraddress/folder/$depot/$date/$tournr/"); // (It is an intranet script) $files = glob("http://serveraddress/folder/$depot/$date/$tournr//*.jpg"); ?> <div class="images"> <p>Selected depot / date / tour:<br /> <strong><?php echo "D".$depot." / D".$date." / ".$tournr ?></strong></p> <?php for($i=0; $i<count($files); $i++){ $num = $files[$i]; $filename = basename($num, ".jpg"); //$size = getimagesize($dir.$filename.".jpg"); $width = $size[0]; $height = $size[1]; $filename_explode = explode("-",$filename); $filenam = $filename_explode[1]; ?> <div class="images_result"> <img id="image" src="<?php echo $num; ?>" alt="Signature <?php echo $filename; ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>" /> <p><?php echo $filenam; ?></p> </div> <?php } ?> </div> The code works just fine, but I get this error messages: Warning: opendir(http://serveraddress/folder/0532/20091023/T336/) [ function.opendir ]: failed to open dir: not implemented in D:\xampp\htdocs\folder\images.php on line 10 Selected depot / date / tour: D0532 / D20091023 / T336 Basically I'm trying to open a folder with images that is located on one of our servers, but it wont work Anyone know why? Thanks Quote Link to comment Share on other sites More sharing options...
Schlo_50 Posted November 18, 2009 Share Posted November 18, 2009 I don't think it can find the folder which is bringing up your warning. With opendir() you need paths, not URLs I think? Quote Link to comment Share on other sites More sharing options...
Miko Posted November 18, 2009 Author Share Posted November 18, 2009 No idea, I don't do alot of php development (mostely xhtml, css & jquery). I've found opendir() via google, but don't find anything else Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 18, 2009 Share Posted November 18, 2009 you cannot use opendir on http it can only be used for local paths Quote Link to comment Share on other sites More sharing options...
Miko Posted November 18, 2009 Author Share Posted November 18, 2009 okay, what should I use or do? Thanks Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 18, 2009 Share Posted November 18, 2009 you can use ftp functions to get the directory listing but if it someone elses server I doubt you will get access Quote Link to comment Share on other sites More sharing options...
Miko Posted November 18, 2009 Author Share Posted November 18, 2009 there wouldn't be any permissions violations beause the server is at 2 feet from me But the thing is that I need to print out the content of some folders :/ Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 18, 2009 Share Posted November 18, 2009 if both are your servers you can use ftp but what exactly are you trying to do ? Quote Link to comment Share on other sites More sharing options...
Miko Posted November 18, 2009 Author Share Posted November 18, 2009 Actually I'm building a small web app does should work like this: User goes to the web page where there are 4 different depotnumbers (hard coded) User selects his depot number and get's then a combo box with several dates in it (this is loaded in another script using an Ajax script) User choses date and get's then the images These images are stored on the server off course, I've developed and tested the web app on my local pc (using xampp) so the opendir works fine. But since the users don't open the web app on the server but via there own pc it doesn't work, so as you said, I should use ftp connection then. What function is there for this? Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 18, 2009 Share Posted November 18, 2009 or you can put a PHP script on your image server which gives you the urls of the image, I think that would be better than opening it in ftp, using the same opendir function only you can pass the path to that script and it can return you the urls then you could call that script from within your script on your other server get the urls process them and display them Quote Link to comment Share on other sites More sharing options...
Miko Posted November 18, 2009 Author Share Posted November 18, 2009 lol I've got it just done it with opendir("./folder/"); this works! but the annoying part is .. the files are images, and firefox shows me the images, but not Internet Explorer (tested in IE 6 ,7 Got an idea? Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 18, 2009 Share Posted November 18, 2009 do you have a url where I can check I will be able to know whats exactly is happening Quote Link to comment Share on other sites More sharing options...
Miko Posted November 19, 2009 Author Share Posted November 19, 2009 I would like to, but since it is an intranet app and we don't have a public web server (well there is but this one in another country and we don't have permission ). I can maybe check some free php scripts that gives the opportunity to upload images and view them on a web server, something like wordpress Quote Link to comment Share on other sites More sharing options...
Miko Posted November 19, 2009 Author Share Posted November 19, 2009 lol found id! IE doesn't show images if there isn't a width or height specified (which I haven't done), I've added this and it's working Thanks ! ; Quote Link to comment 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.