hilfe zu variable

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • hilfe zu variable

    hab folgendes problem
    PHP-Code:
    if (($file_count 0) AND ($page != 0))
                    {
                    
    // previous button
                    
    $prev_page $page -1;
                    echo 
    "<br/><a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">Prev</a><br/>";
                    }
                
                
                if ((
    $file_count 0) AND ($last_record $file_count))
                    {
                    
    // next button
                    
    $next_page $page 2;    
                                
                    echo 
    "<br/><a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page\">Next</a><br/>";
                    
                    } 
    dann wird die variable $page nicht richtig übergeben bzw oder auch nicht ausgelesen wo is der fehler?

    das ganze script
    PHP-Code:
    <?
    include("../settings.php");
    $page=($_GET["page"]);
    echo "jetzt kommt page";
    echo $page[0];
    echo "<br/>";
    print_r($_GET);
    //echo $_GET[page];
    if (!isset($page));       //{$page = 0;}
    $total = 0;

    if(!($dp = opendir("./"))) die ("Cannot open ./");
    $file_array = array(); 
    while ($file = readdir ($dp))
        {
        if(substr($file,0,1) != '.' and $file != "index.php")
            {
            $file_array[] =  $file;
            }
        }
    $file_count = count ($file_array);
    sort ($file_array);
    //echo $file_count;
            //echo "nextpage";
            //echo $next_page;
            //echo "<br/>page";
            //echo $page;
            //echo "<br/>url";
            //echo $_SERVER["PHP_SELF"];
                //echo "<br/>";
            if ($file_count > 0)
                {
                $first_record = $page * $conf["items_per_page"];
                $last_record = $first_record + $conf["items_per_page"];
                
                while (list($fileIndexValue, $file_name) = each ($file_array))
                    {
                    
                    if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
                        {
                
                        echo "<a href=\"$file_name\">$file_name</a> (". round(filesize($file_name)/1024,1) . "kb)<br/>";
                        $total = $total + filesize($file_name);
                        }
                    }
                
                if (($file_count > 0) AND ($page != 0))
                    {
                    // previous button
                    $prev_page = $page -1;
                    echo "<br/><a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">Prev</a><br/>";
                    }
                
                
                if (($file_count > 0) AND ($last_record < $file_count))
                    {
                    // next button
                    $next_page = $page + 2;    
                                
                    echo "<br/><a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page\">Next</a><br/>";
                    
                    }
                echo "<br/>Directory:<br/>$file_count ";
                if ($file_count == 1)
                    {echo "file";}
                else
                    {echo "files";}
                    
                echo " (" . round($total/1024,1) . "kb)";
                echo "<br/><a href=\"../index.php\">Home</a>";
                }
            closedir($dp);
            ?>
    EDIT:
    PHP-TAGS sponsored by TBT
    Zuletzt geändert von TBT; 10.11.2003, 21:12.

  • #2
    Du erwartest nicht ernsthaft dass jemand diesen Spaghetticode durchliest???
    Beantworte nie Threads mit mehr als 15 followups...
    Real programmers confuse Halloween and Christmas because OCT 31 = DEC 25

    Kommentar


    • #3
      es tut mir furchbar leid hab ebend ein total crash mit meim wlan gehabt bin schon beim edit

      Kommentar


      • #4
        was passiert, wenn du je einen festen wert für $page & $conf einsetzt?
        Kissolino.com

        Kommentar

        Lädt...
        X