next up previous contents
Next: A.8 text.php4 Up: A. Der Programmcode Previous: A.6 newlogindo.php4

A.7 links.php4


<?
    // Checks Authentication, if valid, show links 
    error_reporting(0); // 0 = none, 63 = full
    include("./config.php4");
    
    // Debug Information and initialisation
    if(!function_exists("mysql_result")) die("<center><b>Error -
        function 'mysql_result' undefined please check
        for MySQL in your server install</b></center>");

    session_register ("user");
    session_register ("pwd");
    headerNoCache();

    // Initialize connection to DB
    $db = mysql_pconnect($hostname, $username, $password);
    mysql_select_db($database, $db); 
    $uuid=checkAuth($user, $pwd, $db);
    
    // Login sucessfull
    if (!isset($lowlimit)) $lowlimit=0;
    echo "
       <wml>
       <card id=\"c1\" title=\"Auswahl\">
       <p>";
       $mysqltime = date("Y-m-d H:i:s");
       mysql_query("update passuser set lastaccess='$mysqltime'
          WHERE uuid='$uuid'",$db);
       $result = mysql_query("SELECT link FROM passdata
          WHERE uuid='$uuid' ORDER BY link LIMIT $lowlimit, ".
          ($maxlinks+1),$db);
       $a=0;
       $shownext=false;
       while ($rowlink = mysql_fetch_row($result))
       {
          echo "<a href=\"text.php4?link=".($a+$lowlimit)."\">"
              .string2unicode($rowlink[0])."</a>";
          echo "<br/>\n";
          $a++;
          $shownext=false;
          if ($a == $maxlinks) {
            // Check, if more links on another page are necessary
            $rowlink = mysql_fetch_row($result);
            if ($rowlink[0] != "") $shownext=true;
          }
       }
       if ($a == 0)
          echo "Noch keine Eintr&#228;ge vorhanden.<br/>";
       if ($shownext)
          echo "<a href=\"links.php4?
             lowlimit=".($lowlimit+$maxlinks)."\">Mehr Links
             </a><br/>";
       if ($lowlimit !=0)
          echo "<a href=\"links.php4?
             lowlimit=".($lowlimit-$maxlinks)."\">Zur&#252;ck
             </a><br/>";
       echo "<a href=\"insert.php4\">Neuer Eintrag</a><br/>";
       echo "<a href=\"index.php4\">Logout</a>
       </p>
       <do type=\"prev\" label=\"Zur&#252;ck\"><prev/></do>
       </card>
       </wml>";
?>



2001-06-21 Copyright by Jens Bierkandt, bierkandt@waptune24.de, waptune24.de