Buy Now
Sign in

Problem with file upload

boccone , May 03 2007, 19:39
B
boccone 1
May 03 2007, 19:39 #313
Dear people I have following Code:
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
$dateiname=$HTTP_POST_FILES['datei']['name'];

move_uploaded_file($HTTP_POST_FILES['datei']['tmp_name'],
    'bilder/'.basename($HTTP_POST_FILES['datei']['name']));

//copy($datei,"bilder/$dateiname");
$groesse=getimagesize("bilder/$dateiname");
$breite=$groesse[0];
$hoehe=$groesse[1];
$typ=$groesse[2];
print $typ;
$hoehe2=$hoehe*100/$breite;
$image1 = imagecreate(100,$hoehe2);
switch ($typ)
{
case 1:
$image = imagecreatefromgif("bilder/$dateiname");
break;
case 2:
$image = imagecreatefromjpeg("bilder/$dateiname");
break;
case 3:
$image = imagecreatefrompng("bilder/$dateiname");
break;
case 4:
$image = imagecreatefromwbmp("bilder/$dateiname");
break;
default: $gestorben="ja";
}
imagecopyresized($image1, $image, 0,0, 0,0,100,$hoehe2,$breite,$hoehe);

switch ($typ)
{
case 1:
imagegif($image1,"bilder/thumbs/$dateiname");
break;
case 2:
imagejpeg($image1,"bilder/thumbs/$dateiname",50);
break;
case 3:
imagepng($image1,"bilder/thumbs/$dateiname");
break;
case 4:
imagewbmp($image1,"bilder/thumbs/$dateiname");
break;
default: $gestorben="ja";
}
print " Das Bild wurde hochgeladen und abgespeichert.".
" Der Thumbnail ist im Ordner thumbs, das Bild in bilder";}
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> Bild upload direkt aus dem Browser </title>
</head>
<body>
<form action="testbild.php" enctype="multipart/form-data" method="post">
Wählen Sie eine Datei
<input type="file" name="datei">
<input type="submit" value="hochladen">
</form>
</body>
</html>

And if make a new folder with the name as in the code: bilder I get error messages (See attached file). What could be the problem?
And in the Line 139 of the file chronocontact.php there is the code: eval( "?>".$rows[0]->onsubmitcode ); but I have no idea what it means!
Thanks for your reply!
Boccone

Post edited by: boccone, at: 2007/05/03 15:41<br><br>Post edited by: boccone, at: 2007/05/03 15:42
admin 29
May 07 2007, 00:03 #316
Hi,

There is no attached file here ??!! I cant see what the error is, try google "eval function php", you will get more info

Max
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!