Bild hochladen funktioniert nicht! Weiße Seite!

F

Fehlerteufel

Hallo,

ich suche schon seit etlichen Stunden in diversen Foren nach einer Lösung und jetzt wurde mir dieses Forum hier empfohlen, ich hoffe, es kann mir einer helfen :).

Ich habe ein Script umprogrammiert, sodass es mir gefällt und auf meinem Home Server (XAMPP) hat alles ohne Probleme funktioniert. Nun habe ich also alles meinen RootServer geladen und dort kommt beim Upload eine weiße Seite. Also nix geht.

Hier der Code, vlt. kann mir einer von euch helfen, ich verzweifel langsam... :

Uploadformular:
HTML:
<form method="post" enctype="multipart/form-data" action="index.php?page=upload" onsubmit="upload.disabled=true">
    <div align="center">
    <label>
    </label>
    <INPUT NAME="userfile" TYPE="file" class="asd" size="50"><br>
Wir erlauben folgende Dateitypen: <b>jpg | jpeg | png | gif</b>
        <br><br><input name="upload" type="submit" class="asd" value="Bild hochladen!"><br>
        </p>
  </div></form>
  <p style="text-align: center">
    <input name="MAX_FILE_SIZE" value="3145728" type="hidden">
    <input name="refer" value="" type="hidden">
    <input name="brand" value="" type="hidden">

</form>

Dann die index.php?page=upload an die alles gesendet wird und dies verarbeiten sollte:

PHP:
<?php
?>
<center><table style="margin-top:20px;width:790px;height:400px;"><tr><td style="border:1px #AAAAAA solid;height:100%;background-color:#FFFFFF;padding:20px;text-align:center;" valign=top>
<script language=Javascript>
		<!--
		var copytoclip=1
		function HighlightAll(theField) 
		{
			var tempval=eval("document."+theField)
			tempval.focus()
			tempval.select()
			if (document.all&&copytoclip==1)
			{
				therange=tempval.createTextRange()
				therange.execCommand("Copy")
				window.status="Der Inhalt markiert und in die Zwischenablage kopiert."
				setTimeout("window.status=''",2400);
			}
		}
		
		function highlight(field)
		{
			field.focus();
			field.select();
		}
		
		
	-->
	</script>
<?
include "config.php";

if (!isset($HTTP_POST_FILES['userfile'])) exit;

if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {

if ($HTTP_POST_FILES['userfile']['size']>$max_size) {
        echo "<font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Es sind nur maximale 5 MB erlaubt. Bitte verkleinere dein Bild.</font><br>\n"; exit; }
if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/png")) {

        if (file_exists("./".$path . $HTTP_POST_FILES['userfile']['name'])) {
                echo "<font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Eine Datei mit diesem Namen existiert bereits. Bitte benenne deine Datei um..</font><br>\n"; exit; }

//generate random number
$zufall = rand(123,999999);
$fupl = "$zufall";
$imgtext = $zufall .$HTTP_POST_FILES['userfile']['name'];
$userip = $_SERVER['REMOTE_ADDR'];
$time = time();

        $res = copy($HTTP_POST_FILES['userfile']['tmp_name'], "./".$path .$fupl .$HTTP_POST_FILES['userfile']['name']);

        if (!$res) { echo "<font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Leider hat das hochladen nicht geklappt :-(. Versuch es bitte nochmal!</font><br>\n"; exit; } else {
	$filelist = fopen("./imgfiles/".$imgtext.".txt","w");
	fwrite($filelist, "images/" ."|".$imgtext."|". $zufall ."|". $userip ."|". $time."|\n"); 
        ?>
<br>

<?
//set url variable
$domst = "";
$drecks = "/";
$imgf = $fupl.$HTTP_POST_FILES['userfile']['name'];
$thbf = $tpath.$imgf;
$urlf = $domst .$domain .$drecks .$path .$imgf;


//create thumbnails
function createthumb($name,$filename,$new_w,$new_h){
	$system=explode('.',$name);
	if (preg_match('/jpg|jpeg|JPG/',$system[1])){
		$src_img=imagecreatefromjpeg($name);
	}
	if (preg_match('/png|PNG/',$system[1])){
		$src_img=imagecreatefrompng($name);
	}
	if (preg_match('/gif|GIF/',$system[1])){
		$src_img=imagecreatefromgif($name);
	}

$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x > $old_y) {
	$thumb_w=$new_w;
	$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x < $old_y) {
	$thumb_w=$old_x*($new_w/$old_y);
	$thumb_h=$new_h;
}
if ($old_x == $old_y) {
	$thumb_w=$new_w;
	$thumb_h=$new_h;
}

$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
	imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); 


if (preg_match("/png/",$system[1]))
{
	imagepng($dst_img,$filename); 
} 
if (preg_match("/gif/",$system[1]))
{
	imagegif($dst_img,$filename);
}
else {
	imagejpeg($dst_img,$filename); 
}
imagedestroy($dst_img); 
imagedestroy($src_img); 
}

createthumb($path.$imgf,$tpath.$imgf,$tsize,$tsize);
?>


<table class="table_decoration" align="center" border="0" cellpadding="5" cellspacing="0" width="760"><tbody><tr><td><p><a href="./"><b>Ein weiteres Bild hochladen?</b></a></p><br>

<p>Mit den folgenden Codes kannst du dein Bild verlinken:</p>
Vorschaubild + Link (Webseitencode):<br>
<input name="thetext" type="text" id="thetext" style="width: 100%;" onClick="highlight(this);" value="&lt;a href='<? echo $domst .$domain .$drecks; ?>index.php?page=detail&id=<? echo $imgf; ?>'&gt;&lt;img src='<? echo $domst.$domain.$drecks.$tpath.$imgf; ?>'&gt;&lt;/a&gt;" size="70"> 
<br>
<br>
Vorschaubild + Link (Forencode):<br>
<input name="thetext" type="text" id="thetext" style="width: 100%;" onClick="highlight(this);" value="[ url=<? echo $domst .$domain .$drecks; ?>index.php?page=detail&id=<? echo $imgf; ?>][ img]<? echo $domst.$domain.$drecks.$tpath.$imgf; ?>[ /img][ /url]" size="70"> 
	
<br>
	<br><br><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td valign="bottom">
</td><td width="20">&nbsp;</td><td valign="top"><p>&nbsp;</p>
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><br>

<center><a href='index.php?page=detail&id=<? echo $imgf; ?>'><img src='images/<? echo $imgf ?>' border="0"></a></center>
</td><td width="10">&nbsp;</td><td>



				
</td></tr></tbody></table></td></tr></tbody></table><br><br>


</td></tr>
</body></html></tr>
<?

}
} else { echo "<img src=\"templates/img/critical.png\"><br><br><b><font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Entweder hast du kein Bild ausgewählt oder dein Bild hat ein falsches Dateiformat!</font></b><br>\n"; }
}

?>
</table>
<br><br>

</center></td></tr></table><p style="margin:3px;text-align:center">

<?

?>

Schonmal vielen Dank im Vorraus!

Gruß
Chris
 
Zuletzt bearbeitet von einem Moderator:
Habs mir noch nicht ganz angeschaut, aber was mir schonmal stark ins Auge springt ist:

PHP:
if (!isset($HTTP_POST_FILES['userfile'])) exit; 

{

Zum einen was soll die Klammer auf da? Zum anderen, eine weiße Seite spricht doch stark das hier exitted wird ;)
Ansonsten kann ich mir nichts vorstellen was für nen weißen Bildschirm sorgen könnte, also versuch halt mal das exit; durch nen die("test"); zu ersetzten...
 
Habs mir noch nicht ganz angeschaut, aber was mir schonmal stark ins Auge springt ist:

PHP:
if (!isset($HTTP_POST_FILES['userfile'])) exit; 

{

Zum einen was soll die Klammer auf da? Zum anderen, eine weiße Seite spricht doch stark das hier exitted wird ;)
Ansonsten kann ich mir nichts vorstellen was für nen weißen Bildschirm sorgen könnte, also versuch halt mal das exit; durch nen die("test"); zu ersetzten...

Mit die("test); erscheint immer noch ne weiße Seite. Wenn ich des exit entferne, dann zeigt er mir zwar ne seite an, allerdings mit der Fehlermeldung, dass das Bild nicht hochgeladen werden konnte (CHMOD und alles korrekt gesetzt).

Die Klammer auf definiert einen bestimmten Bereich (zumindest geht gar nix mehr, wenn ich sie entferne ;-) ).

Ich hoffe, Du kannst mir helfen.
 
Zuletzt bearbeitet von einem Moderator:
doch, des mit dem die("test") funktioniert. War mein Fehler :). Aber hochladen usw. klappt trotzdem nicht...

Jetzt hab ichs am anfang folgender maßen geändert:

PHP:
if (!isset($HTTP_POST_FILES['userfile']));

Nun wird aber immer nur eine Fehlermeldung angezeigt und zwar die ganz am Schluss:

PHP:
}
} else { echo "<img src=\"templates/img/critical.png\"><br><br><b><font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Entweder hast du kein Bild ausgewählt oder dein Bild hat ein falsches Dateiformat!</font></b><br>\n"; }
}
 
Zuletzt bearbeitet von einem Moderator:
Hi,
als erstes fällt auf, dass du nirgends $max_size einem Wert zuweist, weshalb auch nichts hochgeladen wird. Desweiteren würde ich dir raten error_reporting(E_ALL); ganz oben in deinem Skript einzufügen und die ganzen Fehler beheben. Dann sollte es auch klappen.

edit:
Mal ein Beispiel:
PHP:
$imgtext = $zufall .$HTTP_POST_FILES['userfile']['name'];
$filelist = fopen("./imgfiles/".$imgtext.".txt","w");
würde bei dir so aussehen:
PHP:
fopen(".../imgfiles/55858bild.jpg.txt","w")




schiese
 
Zuletzt bearbeitet:
Hi,

$max_size wird in der config.php definiert:

PHP:
$max_size = "503600000000000000000000000000000000000";          			//max. allowed size

Das Errorreporting bringt gar nichts, es wird weiterhin nur eine weiße Seite angezeigt.

Du meinst, ich muss den Punkt (.) entfernen? Versteh ich grad nicht ganz... Ich hoffe, du kannst mir weiterhelfen :).

Im Moment sieht die Datei so aus:
PHP:
<?php
error_reporting(E_ALL);
?>
<center><table style="margin-top:20px;width:790px;height:400px;"><tr><td style="border:1px #AAAAAA solid;height:100%;background-color:#FFFFFF;padding:20px;text-align:center;" valign=top>
<script language=Javascript>
		<!--
		var copytoclip=1
		function HighlightAll(theField) 
		{
			var tempval=eval("document."+theField)
			tempval.focus()
			tempval.select()
			if (document.all&&copytoclip==1)
			{
				therange=tempval.createTextRange()
				therange.execCommand("Copy")
				window.status="Der Inhalt markiert und in die Zwischenablage kopiert."
				setTimeout("window.status=''",2400);
			}
		}
		
		function highlight(field)
		{
			field.focus();
			field.select();
		}
		
		
	-->
	</script>
<?
include "config.php";

if (!isset($HTTP_POST_FILES['userfile'])) exit;

if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {

if ($HTTP_POST_FILES['userfile']['size']>$max_size) {
        echo "<font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Es sind nur maximale 5 MB erlaubt. Bitte verkleinere dein Bild.</font><br>\n"; exit; }
if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/png")) {

        if (file_exists("./".$path . $HTTP_POST_FILES['userfile']['name'])) {
                echo "<font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Eine Datei mit diesem Namen existiert bereits. Bitte benenne deine Datei um..</font><br>\n"; exit; }

//generate random number
$zufall = rand(123,999999);
$fupl = "$zufall";
$imgtext = $zufall .$HTTP_POST_FILES['userfile']['name'];
$userip = $_SERVER['REMOTE_ADDR'];
$time = time();

        $res = copy($HTTP_POST_FILES['userfile']['tmp_name'], "./".$path .$fupl .$HTTP_POST_FILES['userfile']['name']);

        if (!$res) { echo "<font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Leider hat das hochladen nicht geklappt :-(. Versuch es bitte nochmal!</font><br>\n"; exit; } else {
	$filelist = fopen("./imgfiles/".$imgtext.".txt","w");
	fwrite($filelist, "images/" ."|".$imgtext."|". $zufall ."|". $userip ."|". $time."|\n"); 
        ?>
<br>

<?
//set url variable
$domst = "";
$drecks = "";
$imgf = $fupl.$HTTP_POST_FILES['userfile']['name'];
$thbf = $tpath.$imgf;
$urlf = $domst .$domain .$drecks .$path .$imgf;


//create thumbnails
function createthumb($name,$filename,$new_w,$new_h){
	$system=explode('.',$name);
	if (preg_match('/jpg|jpeg|JPG/',$system[1])){
		$src_img=imagecreatefromjpeg($name);
	}
	if (preg_match('/png|PNG/',$system[1])){
		$src_img=imagecreatefrompng($name);
	}
	if (preg_match('/gif|GIF/',$system[1])){
		$src_img=imagecreatefromgif($name);
	}

$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x > $old_y) {
	$thumb_w=$new_w;
	$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x < $old_y) {
	$thumb_w=$old_x*($new_w/$old_y);
	$thumb_h=$new_h;
}
if ($old_x == $old_y) {
	$thumb_w=$new_w;
	$thumb_h=$new_h;
}

$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
	imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); 


if (preg_match("/png/",$system[1]))
{
	imagepng($dst_img,$filename); 
} 
if (preg_match("/gif/",$system[1]))
{
	imagegif($dst_img,$filename);
}
else {
	imagejpeg($dst_img,$filename); 
}
imagedestroy($dst_img); 
imagedestroy($src_img); 
}

createthumb($path.$imgf,$tpath.$imgf,$tsize,$tsize);
?>


<table class="table_decoration" align="center" border="0" cellpadding="5" cellspacing="0" width="760"><tbody><tr><td><p><a href="./"><b>Ein weiteres Bild hochladen?</b></a></p><br>

<p>Mit den folgenden Codes kannst du dein Bild verlinken:</p>
Vorschaubild + Link (Webseitencode):<br>
<input name="thetext" type="text" id="thetext" style="width: 100%;" onClick="highlight(this);" value="&lt;a href='<? echo $domst .$domain .$drecks; ?>index.php?page=detail&id=<? echo $imgf; ?>'&gt;&lt;img src='<? echo $domst.$domain.$drecks.$tpath.$imgf; ?>'&gt;&lt;/a&gt;" size="70"> 
<br>
<br>
Vorschaubild + Link (Forencode):<br>
<input name="thetext" type="text" id="thetext" style="width: 100%;" onClick="highlight(this);" value="[ url=<? echo $domst .$domain .$drecks; ?>index.php?page=detail&id=<? echo $imgf; ?>][ img]<? echo $domst.$domain.$drecks.$tpath.$imgf; ?>[ /img][ /url]" size="70"> 
	
<br>
	<br><br><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td valign="bottom">
</td><td width="20">&nbsp;</td><td valign="top"><p>&nbsp;</p>
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><br>

<center><a href='index.php?page=detail&id=<? echo $imgf; ?>'><img src='images/<? echo $imgf ?>' border="0"></a></center>
</td><td width="10">&nbsp;</td><td>



				
</td></tr></tbody></table></td></tr></tbody></table><br><br>


</td></tr>
</body></html></tr>
<?

}
} else { echo "<img src=\"templates/img/critical.png\"><br><br><b><font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Entweder hast du kein Bild ausgewählt oder dein Bild hat ein falsches Dateiformat!</font></b><br>\n"; }
}

?>
</table>
<br><br>

</center></td></tr></table><p style="margin:3px;text-align:center">

<?

?>
 
Zuletzt bearbeitet von einem Moderator:
So, habe aus $HTTP_POST_FILES --> $_FILES gemacht und folgende Zeile weggelassen : if (!isset($HTTP_POST_FILES['userfile'])) exit; und er gibt mir jetzt ne Fehlermeldung, dass er das Bild nicht hochladen kann.
Häng doch bitte die config.php mal mit an, da scheinen ja doch ein paar wichtige Sachen drin zu sein.

edit:
Auf deinem XAMPP kannst du die Fehlermeldungen alle sehen.

schiese
 
Zuletzt bearbeitet:
So, habe aus $HTTP_POST_FILES --> $_FILES gemacht und folgende Zeile weggelassen : if (!isset($HTTP_POST_FILES['userfile'])) exit; und er gibt mir jetzt ne Fehlermeldung, dass er das Bild nicht hochladen kann.
Häng doch bitte die config.php mal mit an, da scheinen ja doch ein paar wichtige Sachen drin zu sein.

edit:
Auf deinem XAMPP kannst du die Fehlermeldungen alle sehen.

schiese

Soll ich jetzt alle $HTTP_POST_FILES durch $_FILES erseetzen? Habs jetzt mal so gemacht.

Online zeigt er mir jetzt gar nichts an... Immer noch die weiße Seite.

Die config.php:

PHP:
<?php
$compname = "Piccas.de";
////Your Company Name

$slogan = " DEIN Speicherplatz für Bilder";
//// Your Company Slogan

$scripturl = "http://www.piccas.de/piccas-new/";
//// the URL to this script with a trailing slash

$adminpass = "*entfernt*";
//// set this password to something other than default
//// it will be used to access the admin panel

$topten = false;
//// Make It true if you want to enable Top ten files

$maxfilesize = 5;
//// the maximum file size allowed to be uploaded (in megabytes)

$downloadtimelimit = 1;
//// time users must wait before downloading another file (in minutes)

$uploadtimelimit = 0.1;
//// time users must wait before uploading another file (in minutes)

$nolimitsize = 0.5;
//// if a file is under this many megabytes, there is no time limit

$deleteafter = 365;
//// delete files if not downloaded after this many days

$downloadtimer = 10;
//// length of the timer on the download page (in seconds)

$enable_filelist = true;
//// allows users to see a list of uploaded files. set to false to disable

$shourturl = false;
//// Short url Eg yourdomain.com/13232 needs mod_rewrite enabled. For More Info See Our Froum

$allowedtypes = array("gif","jpg","jpeg","JPG","JPEG","GIF");
//// remove the //'s from the above line to enable file extention blocking
//// only file extentions that are noted in the above array will be allowed

//BILDER UPLOADEN!
$domain = "http:/www.piccas.de/piccas-new/"; 	//your domain, eg "http://domain.com/upload/", add ending slash!
$name = "Piccas.de"; //your hosting name

//Optional
$max_size = 503600000000000000000000000000000000000;          			//max. allowed size
$max_size_mb = "5";					// max. allowed size IN MB 
$tsize = "100";						//thumbnails size (pixel)
$path = "images/";   					//your image path, where the images should be uploaded to
$tpath = "thumbs/";					//your thumbnails path

$enable_imagebrowse = true;
//// allows users to see a list of uploaded images. set to false to disable


?>

Ich hoffe, du findest den Fehler :).
 
Zuletzt bearbeitet von einem Moderator:
Hi,
bei mir klappt es. Hier klicken

Was für Rechte haben denn die 3 Ordner: images, imgfiles, thumbs? Setz sie mal auf 777.

PHP:
<?php
error_reporting(E_ALL);
?>
<center><table style="margin-top:20px;width:790px;height:400px;"><tr><td style="border:1px #AAAAAA solid;height:100%;background-color:#FFFFFF;padding:20px;text-align:center;" valign=top>
<script language=Javascript>
        <!--
        var copytoclip=1
        function HighlightAll(theField) 
        {
            var tempval=eval("document."+theField)
            tempval.focus()
            tempval.select()
            if (document.all&&copytoclip==1)
            {
                therange=tempval.createTextRange()
                therange.execCommand("Copy")
                window.status="Der Inhalt markiert und in die Zwischenablage kopiert."
                setTimeout("window.status=''",2400);
            }
        }
        
        function highlight(field)
        {
            field.focus();
            field.select();
        }
        
        
    -->
    </script>
<?
include "config.php";

if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {

if ($_FILES['userfile']['size']>$max_size) {
        echo "<font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Es sind nur maximale 5 MB erlaubt. Bitte verkleinere dein Bild.</font><br>\n"; exit; }
if (($_FILES['userfile']['type']=="image/gif") || ($_FILES['userfile']['type']=="image/pjpeg") || ($_FILES['userfile']['type']=="image/jpeg") || ($_FILES['userfile']['type']=="image/png")) {

        if (file_exists("./".$path . $_FILES['userfile']['name'])) {
                echo "<font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Eine Datei mit diesem Namen existiert bereits. Bitte benenne deine Datei um..</font><br>\n"; exit; }

//generate random number
$zufall = rand(123,999999);
$fupl = "$zufall";
$imgtext = $zufall .$_FILES['userfile']['name'];
$userip = $_SERVER['REMOTE_ADDR'];
$time = time();

        $res = copy($_FILES['userfile']['tmp_name'], "./".$path .$fupl .$_FILES['userfile']['name']);

        if (!$res) { echo "<font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Leider hat das hochladen nicht geklappt :-(. Versuch es bitte nochmal!</font><br>\n"; exit; } else {
    $filelist = fopen("./imgfiles/".$imgtext.".txt","w");
    fwrite($filelist, "images/" ."|".$imgtext."|". $zufall ."|". $userip ."|". $time."|\n"); 
        ?>
<br>

<?
//set url variable
$domst = "";
$drecks = "";
$imgf = $fupl.$_FILES['userfile']['name'];
$thbf = $tpath.$imgf;
$urlf = $domst .$domain .$drecks .$path .$imgf;


//create thumbnails
function createthumb($name,$filename,$new_w,$new_h){
    $system=explode('.',$name);
    if (preg_match('/jpg|jpeg|JPG/',$system[1])){
        $src_img=imagecreatefromjpeg($name);
    }
    if (preg_match('/png|PNG/',$system[1])){
        $src_img=imagecreatefrompng($name);
    }
    if (preg_match('/gif|GIF/',$system[1])){
        $src_img=imagecreatefromgif($name);
    }

$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x > $old_y) {
    $thumb_w=$new_w;
    $thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x < $old_y) {
    $thumb_w=$old_x*($new_w/$old_y);
    $thumb_h=$new_h;
}
if ($old_x == $old_y) {
    $thumb_w=$new_w;
    $thumb_h=$new_h;
}

$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
    imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); 


if (preg_match("/png/",$system[1]))
{
    imagepng($dst_img,$filename); 
} 
if (preg_match("/gif/",$system[1]))
{
    imagegif($dst_img,$filename);
}
else {
    imagejpeg($dst_img,$filename); 
}
imagedestroy($dst_img); 
imagedestroy($src_img); 
}

createthumb($path.$imgf,$tpath.$imgf,$tsize,$tsize);
?>


<table class="table_decoration" align="center" border="0" cellpadding="5" cellspacing="0" width="760"><tbody><tr><td><p><a href="./"><b>Ein weiteres Bild hochladen?</b></a></p><br>

<p>Mit den folgenden Codes kannst du dein Bild verlinken:</p>
Vorschaubild + Link (Webseitencode):<br>
<input name="thetext" type="text" id="thetext" style="width: 100%;" onClick="highlight(this);" value="&lt;a href='<? echo $domst .$domain .$drecks; ?>index.php?page=detail&id=<? echo $imgf; ?>'&gt;&lt;img src='<? echo $domst.$domain.$drecks.$tpath.$imgf; ?>'&gt;&lt;/a&gt;" size="70"> 
<br>
<br>
Vorschaubild + Link (Forencode):<br>
<input name="thetext" type="text" id="thetext" style="width: 100%;" onClick="highlight(this);" value="[ url=<? echo $domst .$domain .$drecks; ?>index.php?page=detail&id=<? echo $imgf; ?>][ img]<? echo $domst.$domain.$drecks.$tpath.$imgf; ?>[ /img][ /url]" size="70"> 
    
<br>
    <br><br><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td valign="bottom">
</td><td width="20">&nbsp;</td><td valign="top"><p>&nbsp;</p>
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><br>

<center><a href='index.php?page=detail&id=<? echo $imgf; ?>'><img src='images/<? echo $imgf ?>' border="0"></a></center>
</td><td width="10">&nbsp;</td><td>



                
</td></tr></tbody></table></td></tr></tbody></table><br><br>


</td></tr>
</body></html></tr>
<?

}
} else { echo "<img src=\"templates/img/critical.png\"><br><br><b><font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Entweder hast du kein Bild ausgewählt oder dein Bild hat ein falsches Dateiformat!</font></b><br>\n"; }
}

?>
</table>
<br><br>

</center></td></tr></table><p style="margin:3px;text-align:center">

schiese
 
Hi,
bei mir klappt es. Hier klicken

Was für Rechte haben denn die 3 Ordner: images, imgfiles, thumbs? Setz sie mal auf 777.

schiese

Hallo schiese,

vielen Dank für deine Hilfe. Jetzt funktioniert es einwandfrei :). Dankeschön. Also dieses Forum ist echt klasse, werd ich mir merken, wenn ich wieder einmal Probleme habe :).

Gruß
Chris

P.S.: Wenn du willst, setze ich von der Webseite auch gerne einen Link auf deine Seite :). Als kleines Dankeschön :).
 
Zurück