Darstellen von Urls aus einer Datenbank ! Problem ! :-(

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

  • Darstellen von Urls aus einer Datenbank ! Problem ! :-(

    Ich habe folgendes Problem:

    Ich habe eine Dynamische Tabelle erstellt.

    In dieser dynamischen Tabelle möchte ich die Namen meiner Spiele abfragen,
    und den dazugehörigen ftp Link um es herunterzuladen.
    Funktioniert alles auch soweit. Nur das ich meine Links als Text im html wiedergegeben werden, es soll aber als anklick link dargestellt werden und am besten wäre anstatt des linkes ein bild.


    Hier der Code :-)

    PHP-Code:

    <?php require_once('../Connections/verbindung.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function 
    GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
    {
      if (
    PHP_VERSION 6) {
        
    $theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }

      
    $theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

      switch (
    $theType) {
        case 
    "text":
          
    $theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
          break;    
        case 
    "long":
        case 
    "int":
          
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case 
    "double":
          
    $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case 
    "date":
          
    $theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
          break;
        case 
    "defined":
          
    $theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
          break;
      }
      return 
    $theValue;
    }
    }

    $maxRows_Recordset1 10;
    $pageNum_Recordset1 0;
    if (isset(
    $_GET['pageNum_Recordset1'])) {
      
    $pageNum_Recordset1 $_GET['pageNum_Recordset1'];
    }
    $startRow_Recordset1 $pageNum_Recordset1 $maxRows_Recordset1;

    mysql_select_db($database_verbindung$verbindung);
    $query_Recordset1 "SELECT `Spiel Name`, `Download 1` FROM `spiele datenbank`";
    $query_limit_Recordset1 sprintf("%s LIMIT %d, %d"$query_Recordset1$startRow_Recordset1$maxRows_Recordset1);
    $Recordset1 mysql_query($query_limit_Recordset1$verbindung) or die(mysql_error());
    $row_Recordset1 mysql_fetch_assoc($Recordset1);

    if (isset(
    $_GET['totalRows_Recordset1'])) {
      
    $totalRows_Recordset1 $_GET['totalRows_Recordset1'];
    } else {
      
    $all_Recordset1 mysql_query($query_Recordset1);
      
    $totalRows_Recordset1 mysql_num_rows($all_Recordset1);
    }
    $totalPages_Recordset1 ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/normal.dwt.php" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Unbenanntes Dokument</title>
    <!-- InstanceEndEditable -->
    <link href="../styles/thrColFixHdr.css" rel="stylesheet" type="text/css" /><!--[if IE 5]>
    <style type="text/css"> 
    /* Fügen Sie CSS-Box-Modell-Korrekturen für IE 5* in diesen bedingten Kommentar ein. */
    .thrColFixHdr #sidebar1 { width: 180px; }
    .thrColFixHdr #sidebar2 { width: 190px; }
    </style>
    <![endif]--><!--[if IE]>
    <style type="text/css"> 
    /* Fügen Sie CSS-Korrekturen für alle IE-Versionen in diesen bedingten Kommentar ein. */
    .thrColFixHdr #sidebar2, .thrColFixHdr #sidebar1 { padding-top: 30px; }
    .thrColFixHdr #mainContent { zoom: 1; }
    /* Mit der obigen proprietären Zoom-Eigenschaft wird IE die Eigenschaft hasLayout zugewiesen, die zur Verhinderung verschiedener Fehler erforderlich ist. */
    </style>
    <![endif]-->
    <!-- InstanceBeginEditable name="head" -->
    <!-- InstanceEndEditable -->
    <script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    </head>

     

    <body class="thrColFixHdr">

    <div id="container">
      <div id="header"><img src="../images/game_boxx_logo.png" width="533" height="152" alt="logo" />
        
      <!-- end #header -->
      </div>
      <div id="sidebar1">
      <h3>&nbsp;</h3>
      <ul id="MenuBar1" class="MenuBarVertical">
              <li><a href="../index.php" title="Startseite">Home</a>                  </li>
              <li><a href="#">Element 2</a></li>
              <li><a class="MenuBarItemSubmenu" href="#">Element 3</a>
                      <ul>
                              <li><a class="MenuBarItemSubmenu" href="#">Element 3.1</a>
                                      <ul>
                                              <li><a href="#">Element 3.1.1</a></li>
                                              <li><a href="#">Element 3.1.2</a></li>
                                              </ul>
                                      </li>
                              <li><a href="#">Element 3.2</a></li>
                              <li><a href="#">Element 3.3</a></li>
                              </ul>
                      </li>
              <li><a href="../kontakt/index.php">Kontakt</a></li>
              </ul>
        </div>
      <div id="sidebar2">
      
      <!-- BEGIN PARTNER PROGRAM - DO NOT CHANGE THE PARAMETERS OF THE HYPERLINK -->
    <script language="javascript" type="text/javascript" src="http://banners.webmasterplan.com/view.asp?ref=247254&site=2769&type=html&hnb=132&js=1"></script>
    <noscript>
     <a href="http://partners.webmasterplan.com/click.asp?ref=247254&site=2769&type=b1&bnb=1" target="_blank"><img src="http://banners.webmasterplan.com/view.asp?ref=247254&site=2769&b=1" border="0"/></a><br /></noscript>
    <!-- END PARTNER PROGRAM -->


        <h3>&nbsp;</h3>
      <!-- end #sidebar2 --></div>
      <div id="mainContent"><!-- InstanceBeginEditable name="EditRegion1" -->
              <h1> Hauptinhalt </h1>
            <table border="1" cellpadding="2" cellspacing="2">
                    <tr>
                            <td>Spiel Name</td>
                            <td>Download 1</td>
                    </tr>
                    <?php do { ?>
                            <tr>
                                    <td><?php echo $row_Recordset1['Spiel Name']; ?></td>
                                    <td><?php echo '[url="'.$row_Recordset1['Download 1'].'"][img]images/mirror.gif[/img][/url]'?></td>
                            </tr>
                            <?php } while ($row_Recordset1 mysql_fetch_assoc($Recordset1)); ?>
            </table>
        <!-- InstanceEndEditable -->
              <!-- end #mainContent --></div>
        <!-- Dieses clear-Element sollte direkt auf das #mainContent-div folgen, um das #container-div anzuweisen, alle untergeordneten Floats aufzunehmen. --><br class="clearfloat" />
      <div id="footer">
        <p>&nbsp;&nbsp;&nbsp;G4me-Boxx.de&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Kontakt:(email-Bild) </p>
      <!-- end #footer --></div>
    <!-- end #container --></div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>

    <br style="clear:both;" />
          </div>
       </body>

    <!-- InstanceEnd --></html>
    <?php
    mysql_free_result
    ($Recordset1);
    ?>
    </div>

    Hier bei echo wird der Name des Spiels, wie schon gesagt, richtig ausgegeben.

    Aber die Url des Spiels wird auch nur als ganz normaler Test ausgegeben, ohne Bild und nix zum anklicken und runterladen.

    PHP-Code:

    <h1> Hauptinhalt </h1>
            <table border="1" cellpadding="2" cellspacing="2">
                    <tr>
                            <td>Spiel Name</td>
                            <td>Download 1</td>
                    </tr>
                    <?php do { ?>
                            <tr>
                                    <td><?php echo $row_Recordset1['Spiel Name']; ?></td>
                                    <td><?php echo '[url="'.$row_Recordset1['Download 1'].'"][img]images/mirror.gif[/img][/url]'?></td>
                            </tr>
                            <?php } while ($row_Recordset1 mysql_fetch_assoc($Recordset1)); ?>
            </table>

    Für Jede Hilfe bin ich dankbar
    Angehängte Dateien

  • #2
    Re: Darstellen von Urls aus einer Datenbank ! Problem ! :-(

    Regeln lesen, Code umbrechen!
    I don't believe in rebirth. Actually, I never did in my whole lives.

    Kommentar


    • #3
      wieso machst du statt

      PHP-Code:
      <td><?php echo '[url="'.$row_Recordset1['Download 1'].'"][/url]'?></td>
      nicht einfach

      PHP-Code:
      <td><?php echo '<a href="'.$row_Recordset1['Download 1'].'"]</a>'?></td>
      versteh ehrlich net wieso du das oben so formatierst [url= is ja kein HTML Tag.

      Kommentar


      • #4
        is ja kein HTML Tag.
        Aber BBCode

        Kommentar


        • #5
          a href funktioniert nicht, dann bekomme ich gar nix angezeigt ....

          Kommentar


          • #6
            Weil Dragos Code nicht korrekt geändert ist

            Trotzdem bitte Regeln lesen..

            Kommentar


            • #7
              oki ich habs ^^ jetzt hab ich nur son hässliche blaue umrandung um mein bild

              mhh...



              PHP-Code:
              <tr>                                 <td><?php echo $row_Recordset1['Spiel Name']; ?></td>                                 <td><?php echo '<a href="'.$row_Recordset1['Download 1'].'"><img src="images/down02.gif" alt="" /></a>'?></td>                         </tr>

              joa die regeln hab ich mir jetzt au ma angeschaut ...
              Zuletzt geändert von erniedd; 31.03.2009, 14:08.

              Kommentar


              • #8
                oki ich habs *froh* lalalal

                PHP-Code:
                <td><?php echo '<a href="'.$row_Recordset1['Download 1'].'"><img src="images/down02.gif" border="0" alt="down02.gif" /></a>'?></td>

                Kommentar


                • #9
                  Dann lies dir bitte trotzdem die Regeln:http://www.php-resource.de/forum/sho...threadid=50454 durch!

                  Sonst wirst du hier in Zukunft wohl auf taube Ohren stoßen

                  Kommentar

                  Lädt...
                  X