tutorials.de Buch-Aktion 05/2012
ERLEDIGT
JA
ANTWORTEN
0
ZUGRIFFE
1069
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    grimoh grimoh ist offline Mitglied Bronze
    Registriert seit
    Mar 2005
    Ort
    Voerde
    Beiträge
    25
    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:

    /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
    Das ganze läuft auf BXCP

    In einer import.php frage ich nur ab, in welche Kategorie die Bilder importiert werden sollen!

    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&gt;&gt;</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 ?>
    In der importaction.php SOLL folgendes gemacht werden!

    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

    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');
    ?>
    Und jetzt suche ich meinen Denkfehler.........


    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

    .............
    Ich komme einfach nicht mehr weiter!
    Über ein wenig Hilfe wäre ich sehr dankbar

    GriMoh

    EDIT:

    Also, die importaction.php habe ich folgendermassen geändert:

    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');
    ?>
    So, das mit der Zahl funktioniert noch nicht, was das geringere übel ist! Das als name Bild1....Bild100 eingetragen wird, ABER..

    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

  1. Dateien kopieren!
    Von CosmoKey im Forum Java
    Antworten: 4
    Letzter Beitrag: 13.11.09, 12:19
  2. Dateien kopieren...
    Von Guntpat1981 im Forum Java Grundlagen
    Antworten: 2
    Letzter Beitrag: 08.09.08, 14:29
  3. Dateien Kopieren
    Von pat_00 im Forum .NET Datenverwaltung
    Antworten: 1
    Letzter Beitrag: 11.03.07, 11:32
  4. Dateien kopieren
    Von anmae im Forum C/C++
    Antworten: 4
    Letzter Beitrag: 13.10.05, 13:24
  5. Dateien kopieren
    Von igfas im Forum PHP
    Antworten: 2
    Letzter Beitrag: 22.05.03, 21:25