Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    Dividere gli articoli in + pagine

    Ciao a tutti
    avrei un problema, sto facendo una pagina in cui riporto una serie di articoli utilizzando uno script di gestione news in php questo , vorrei però impostare un limite di 6 articoli per pagina

    (cioè inserisco 6 articoli nella prima pagina altri 6 nella seconda e così via)

    come devo fare?
    grazie

  2. #2
    tra le pillole di qst forum trovi le spiegazioni necessarie...


    per la precisione: http://forum.html.it/forum/showthrea...postid=3654149

  3. #3
    mmm però nn capisco una cosa!!

    questa è la pagina che includo e dove vengono visualizzati gli articoli

    <?php
    // Makes sure that someone isn't trying to view display.php by itself
    if (strstr($PHP_SELF, "displaynews.php")) {
    die();
    }

    // Gets the style.css file
    ?><?php

    // Creates a function named displaynews
    function displaynews() {
    // Gets the info.php file
    require("sqlnews_info.php");

    // Connects to the database server
    mysql_connect($db_host, $db_user, $db_pass) || die ("Cannot cannot to database server.");
    mysql_select_db($db_name) || die ("Cannot cannot to the database.");

    $query = mysql_query("SELECT * FROM $prefix" . "news ORDER BY id DESC");
    while ($row = mysql_fetch_array($query)) {
    $name = $row["name"];
    $email = $row["email"];
    $title = $row["title"];
    $body = $row["body"];
    $date = $row["date"];

    // Gets the layout that will be used to display the news
    $newslayout = file("sqlnews_newslayout.txt");
    $newslayout = implode("", $newslayout);

    // Makes sure there isn't any ugly \ in the news layout
    $newslayout = str_replace("\\", "", $newslayout);

    // Replaces the [] things with actual text
    $newslayout = str_replace("[name]", "$name", $newslayout);
    $newslayout = str_replace("[email]", "$email", $newslayout);
    $newslayout = str_replace("[title]", "$title", $newslayout);
    $newslayout = str_replace("[body]", "$body", $newslayout);
    $newslayout = str_replace("[date]", "$date", $newslayout);

    // Displays the news
    echo $newslayout;
    }
    }

    // Shows the news on the page
    displaynews();

    // The following line is required to stay intact.
    //-||-> Copyright © 2002 Creative-X-Programming <-||-\\
    ?>

    --------------------------------------------------------------------------


    dove dovrei mettere il codice?

  4. #4

  5. #5
    boh raga nn riesco!

  6. #6

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.