ERLEDIGT
JA
JA
ANTWORTEN
0
0
ZUGRIFFE
1069
1069
EMPFEHLEN
-
Hallo,
Ich denke mal, das ist nur wieder ein kleiner Denkfehler, aber nach 3 Tagen experimentieren, mache ich mehr kaputt als fertig
Ich habe folgende Ordner-Struktur:
Das ganze läuft auf BXCP/srv/www/htdocs/web266/html/
/srv/www/htdocs/web266/html/neu/ <--- hier liegt die gesamte homepage
/srv/www/htdocs/web266/html/neu/gallery/import <--- hier ftp uploaded Bilder
/srv/www/htdocs/web266/html/neu/gallery/$categorie/ <--- per php kategorie erstellte bilder
/srv/www/htdocs/web266/html/neu/gallery/thumb/$category <--- per php erzeugte thumbs
In einer import.php frage ich nur ab, in welche Kategorie die Bilder importiert werden sollen!
In der importaction.php SOLL folgendes gemacht werden!PHP-Code:<?php if($access<3) { echo $noacc; } else { ?>
<table cellpadding="0" cellspacing="2" border="0" style="width: 98%;">
<tbody><tr>
<td class="left"><strong>Import>></strong></td>
</tr></tbody></table><br>
<table cellpadding="0" cellspacing="2" border="0" style="width: 98%;"><tbody><tr><td class="main">
<form enctype="multipart/form-data" action="index.php?show=importaction" method="post">
<table style="width: 98%;"><tbody><tr>
<td>Kategorie</td><td class="left">
<select name="category" id="category" class="form">
<option value="">----</option>
<?php
$sql="SELECT * FROM category WHERE `table`= 'gallery' ORDER BY name";
$data=mysql_query($sql, $db);
while ($cat = mysql_fetch_object ($data)) {
print "<option value=\"$cat->short\">$cat->name</option>"; } ?>
</select>
</td></tr><tr><td>Optionen</td><td class="left">
<input type="hidden" class="form" name="compress" value="1" />
<input value="Absenden" class="form" type="submit" enctype="multipart/form-data">
<input value="Nochmal" class="form" type="reset">
</td></tr></tbody></table>
</form></td></tr></tbody></table>
<?php } ?>
Gesamtes Verzeichnis auslesen, Jede Datei, jeweils in
gallery/$category/ UND gallery/thumb/$category/
kopiert werden!
Danach sollen die Dateien verkleinert werden!
Dann sollen die Dateien in eine Datenbank eingetragen werden!
Das versuche ich folgendermassen!
importaction.php
Und jetzt suche ich meinen Denkfehler.........PHP-Code:<?
$category=$_POST['category'];
$name='Bild';
$info='Import';
$zahl=1;
include ("system/func_resize.php");
function kopieren ($ordner) {
$dir = opendir($ordner);
while ($file = readdir($dir)) {
if ($file != '..' && $file != '.' && $file != '') {
copy($file, "thumb/$category/$file");
copy($file, "$category/$file");
resize("$category/$file", $filex, "1000", "400");
resize("thumb/$category/$file", $filex, "75", "75");
$add="INSERT INTO gallery (name, info, thumb, img, category, fav) VALUES ('$name'.'$zahl', '$info', '$file', '$file', '$category', '$fav')";
$sqlaction=mysql_query($add);
$zahl=$zahl++;
}
}
closedir($ordner);
}
kopieren ('gallery/import');
?>
Ich komme einfach nicht mehr weiter!
Warning: copy(Bild000.jpg): failed to open stream: No such file or directory in /srv/www/htdocs/web266/html/neu/show/importaction.php on line 14
Warning: copy(Bild000.jpg): failed to open stream: No such file or directory in /srv/www/htdocs/web266/html/neu/show/importaction.php on line 16
Warning: copy(): open_basedir restriction in effect. File(/Bild000.jpg) is not within the allowed path(s): (/srv/www/htdocs/web266/html/:/srv/www/htdocs/web266/phptmp/:/srv/www/htdocs/web266/files/:/srv/www/htdocs/web266/atd/) in /srv/www/htdocs/web266/html/neu/system/func_resize.php on line 44
Warning: copy(/Bild000.jpg): failed to open stream: Operation not permitted in /srv/www/htdocs/web266/html/neu/system/func_resize.php on line 44
Warning: copy(thumb//Bild000.jpg): failed to open stream: No such file or directory in /srv/www/htdocs/web266/html/neu/system/func_resize.php on line 44
Warning: copy(Bild001.jpg): failed to open stream: No such file or directory in /srv/www/htdocs/web266/html/neu/show/importaction.php on line 14
Warning: copy(Bild001.jpg): failed to open stream: No such file or directory in /srv/www/htdocs/web266/html/neu/show/importaction.php on line 16
Warning: copy(): open_basedir restriction in effect. File(/Bild001.jpg) is not within the allowed path(s): (/srv/www/htdocs/web266/html/:/srv/www/htdocs/web266/phptmp/:/srv/www/htdocs/web266/files/:/srv/www/htdocs/web266/atd/) in /srv/www/htdocs/web266/html/neu/system/func_resize.php on line 44
Warning: copy(/Bild001.jpg): failed to open stream: Operation not permitted in /srv/www/htdocs/web266/html/neu/system/func_resize.php on line 44
Warning: copy(thumb//Bild001.jpg): failed to open stream: No such file or directory in /srv/www/htdocs/web266/html/neu/system/func_resize.php on line 44
.............
Über ein wenig Hilfe wäre ich sehr dankbar
GriMoh
EDIT:
Also, die importaction.php habe ich folgendermassen geändert:
So, das mit der Zahl funktioniert noch nicht, was das geringere übel ist! Das als name Bild1....Bild100 eingetragen wird, ABER..PHP-Code:<?
include ("system/func_resize.php");
function kopieren ($ordner) {
$dir = opendir($ordner);
$zahl=0;
while ($file = readdir($dir)) {
if ($file != '..' && $file != '.' && $file != '') {
$category=$_POST['category'];
$name='Bild';
$info='Import';
copy($file, "gallery/thumb/$category/$file");
copy($file, "gallery/$category/$file");
resize("gallery/$category/$file", $filex, "1000", "400");
resize("gallery/thumb/$category/$file", $filex, "75", "75");
$add="INSERT INTO gallery (name, info, thumb, img, category, fav) VALUES ('$name $zahl', '$info', '$file', '$file', '$category', '$fav')";
$sqlaction=mysql_query($add);
$zahl=$zahl++;
}
}
closedir($ordner);
}
kopieren ('gallery/import');
?>
der Ordner $category ist von PHP erstellt worden! Jetzt muss das PHP script die datei, die per ftp hochgeladen wurde, in den ordner $category UND thumb/$category kopieren!
nur WIEEEEE
argh *am galgen hänge*Geändert von grimoh (22.06.05 um 13:38 Uhr) Grund: Einen Fehler gefunden, neue Frage taucht auf! ;)
Ähnliche Themen
-
Dateien kopieren!
Von CosmoKey im Forum JavaAntworten: 4Letzter Beitrag: 13.11.09, 12:19 -
Dateien kopieren...
Von Guntpat1981 im Forum Java GrundlagenAntworten: 2Letzter Beitrag: 08.09.08, 14:29 -
Dateien Kopieren
Von pat_00 im Forum .NET DatenverwaltungAntworten: 1Letzter Beitrag: 11.03.07, 11:32 -
Dateien kopieren
Von anmae im Forum C/C++Antworten: 4Letzter Beitrag: 13.10.05, 13:24 -
Dateien kopieren
Von igfas im Forum PHPAntworten: 2Letzter Beitrag: 22.05.03, 21:25





Zitieren
Login






[PHP][Snippet] Array zu XML konvertieren