Nicht mehr ganz neu hier
ich habe einen code geschrieben und bekomme eine fehler meldung wenn ich ihn ausfüren möchte
Fhelermeldung:
Warning: require_once(config.inc.php) []: failed to open stream: No such file or directory in F:\UsbWebserver\Root\ftpgallery\fotos\test\index.php on line 4
Fatal error: require_once() []: Failed opening required 'config.inc.php' (include_path='.;C:\php5\pear') in F:\UsbWebserver\Root\ftpgallery\fotos\test\index.php on line 4
code der seite:
die config
was mache ich verkehrt?
danke für eure hilfe
Fhelermeldung:
Warning: require_once(config.inc.php) []: failed to open stream: No such file or directory in F:\UsbWebserver\Root\ftpgallery\fotos\test\index.php on line 4
Fatal error: require_once() []: Failed opening required 'config.inc.php' (include_path='.;C:\php5\pear') in F:\UsbWebserver\Root\ftpgallery\fotos\test\index.php on line 4
code der seite:
PHP:
<?php
require_once('config.inc.php');
function create_thumb($filename,$width=THUMB_WIDTH,$height=THUMB_HEIGHT){
if(!file_exists("thumb/thumb_".substr($filename,0, -4).".png")){
$info = getimagesize($filename);
$factor = $width/$info[0];
if(($height/$info[1])<$factor)$factor = $height/$info[1];
$factor = floor($factor*10000)/10000;
$im = imagecreatetruecolor(THUMB_WIDTH, THUMB_HEIGHT);
$back_color = imagecolorallocate($im,THUMB_BG_COLOR_RED,THUMB_BG_COLOR_GREEN,THUMB_BG_COLOR_BLUE);
imagefill($im,0,0,$back_color);
switch ($info[2]) {
case 1:
$image = imagecreatefromgif($filename);
break;
case 2:
$image = imagecreatefromjpeg($filename);
break;
case 3:
$image = imagecreatefrompng($filename);
break;
}
imagecopyresized($im, $image,(THUMB_WIDTH-intval(round($info[0]*$factor,0)))/2, (THUMB_HEIGHT-intval(round($info[1]*$factor,0)))/2, 0, 0, intval(round($info[0]*$factor,0)), intval(round($info[1]*$factor,0)), $info[0], $info[1]);
imagepng($im,("thumb/thumb_".substr($filename,0, -4).".png"));
imagedestroy($im);
}
return TRUE;
}
if(!is_dir("thumb")) mkdir("thumb");
$pictures = glob('*.{jpg,png,gif}',GLOB_BRACE);
if($pictures){
echo '<ul class="gallery">'."\n";
foreach ($pictures as $filename) {
if(create_thumb($filename)){
echo '<li>';
echo "<a href='$filename' rel='shadowbox[Mixed];'><img src='thumb/thumb_" . substr($filename,0, -4) . ".png' /></a>";
echo '</li>'."\n";
}
}
echo '</ul>'."\n";
}
?>
<link rel="stylesheet" type="text/css" href="../../css/gallery.css">
<link rel="stylesheet" type="text/css" href="../../css/shadowbox/shadowbox.css">
<script type="text/javascript" src="../../css/shadowbox/shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.init({
counterType: "skip",
continuous: true,
enableKeys: true,
displayNav: true,
slideshowDelay: 3
});
</script>
PHP:
<?php
define('THUMB_WIDTH' , 160); // Breite des Thumbnails
define('THUMB_HEIGHT', 120); // Höhe des Thumbnails
define('THUMB_BG_COLOR_RED' , 200); // Rotanteil der Hintergrundfarbe des Thumbnails (0-255)
define('THUMB_BG_COLOR_GREEN', 200); // Grünanteil der Hintergrundfarbe des Thumbnails (0-255)
define('THUMB_BG_COLOR_BLUE' , 200); // Blauanteil der Hintergrundfarbe des Thumbnails (0-255)
?>
danke für eure hilfe
Zuletzt bearbeitet: