Martin Seidel: Javascript Überprüfung ob Datei vorhanden

Beitrag lesen

Es funktioniert! Echt cool, ich wusste garnicht dass man mit php soviel machen kann. Falls jemand was ähnliches sucht hier mal der Quelltext:

<?php
	
$nummer = 100;

for($i=0; $i < $nummer; $i++) 
{

	if($i<10)
	{
		$format = 'http://localhost/zpic-carpet-klassisch-0%d.php';
		$link = sprintf($format, $i);
		
		$format = 'images/carpet_preview/klassisch/0%d.jpg';		
		$bild = sprintf($format, $i);
			
	}
	else
	{
		$format = 'http://localhost/zpic-carpet-klassisch-%d.php';
		$link = sprintf($format, $i);
		
		$format = 'images/carpet_preview/klassisch/%d.jpg';		
		$bild = sprintf($format, $i);
	}
	
   if (file_exists($bild)) 
   {
  	  echo '<a href=' .$link. ' alt=" "><img src='.$bild.' class="zoom-gal" /></a>';
  	}
  	else 
  	{
  	}
}
 
?>

Gruß Martin