Jump to content

[SOLVED] opendir error


Miko

Recommended Posts

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 :)

Link to comment
https://forums.phpfreaks.com/topic/181978-solved-opendir-error/
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/181978-solved-opendir-error/#findComment-959967
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/181978-solved-opendir-error/#findComment-959968
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/181978-solved-opendir-error/#findComment-960949
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.