Visualizzazione dei risultati da 1 a 10 su 10
  1. #1
    Utente di HTML.it L'avatar di LA VALE
    Registrato dal
    Sep 2003
    Messaggi
    667

    guestbook che non funziona

    Ho questo script per un guestbook che non usa database, ma file inc su cui scrive i vari messaggi, solo che cliccando su "inserisci messaggio", non succede nulla: il form per l'inserimento di un nuovo messaggio non si visualizza... Sapreste aiutarmi?

    <?


    // Max entries per page

    $maxperpage = "20";



    // Allow HTML in guestbook submissions? (0 = No, 1 = Yes)

    $allowhtml = "0";



    /* --------------- DO NOT EDIT BELOW THIS LINE -------------- */



    /* --------------- PRE-CONFIGURED LAYOUTS ----------------- */









    $addform = "<FORM ACTION=\"$PHP_SELF?addsubmit=true\" METHOD=\"POST\">\n";

    $addform .= "<table border=\"0\" cols=\"2\" width=\"500\">\n";

    $addform .= "<tr>\n";

    $addform .= "<td width=\"100\">Nome:</td>\n";

    $addform .= "<td width=\"400\"><input type=\"text\" name=\"name\"></td>\n";

    $addform .= "</tr><tr>\n";

    $addform .= "<td width=\"100\">E-Mail:</td>\n";

    $addform .= "<td width=\"400\"><input type=\"text\" name=\"email\"></td>\n";

    $addform .= "</tr><tr>\n";

    $addform .= "<td width=\"100\">Messaggio:</td>\n";

    $addform .= "<td width=\"400\"><TEXTAREA name=\"message\" cols=\"50\" rows=\"15\"></TEXTAREA></td>\n";

    $addform .= "</tr><tr>\n";

    $addform .= "<td width=\"100\"></td>\n";

    $addform .= "<td width=\"400\"><input type=\"submit\" value=\"Inserisci\">\n";

    $addform .= "</tr></table>\n";

    $addform .= "</FORM>\n";













    include ("entries.inc");

    include ("entrycounter.inc");





    IF (!isset($add) and !isset($addsubmit))

    {

    echo ("<A HREF=\"$PHP_SELF?add=true\">Inserisci un messaggio</a>");




    $maxperpage = $maxperpage + 0;





    IF (!isset($start))

    {

    $start = $lastentry;

    }



    $end = $start - $maxperpage;



    $count = $start;





    while ($count <= $start and $count > $end and $count > 0)

    {

    $entryid = "entry" . $count;



    echo ("<table border=0 cols=2 width=500>");



    IF (isset($$entryid))

    {



    while (list ($variable, $value) = each($$entryid))

    {



    IF ($allowhtml == 0)

    {

    $value = Strip_tags($value);

    }



    IF ($variable == "E-Mail")

    {

    echo ("<tr>\n<td width=100>\n$variable:\n</td>\n<td width=400>\n<A HREF=\"mailto:$value\">$value</a>\n</td>\n</tr>\n");

    }



    ELSE IF ($variable == "Messaggio")

    {

    $value = str_replace("\\\"", "\"", $value);

    echo ("<tr>\n<td width=100>\n$variable:\n</td>\n<td width=400>\n$value\n</td>\n</tr>\n");

    }



    ELSE

    {

    echo ("<tr>\n<td width=100>\n$variable:\n</td>\n<td width=400>\n$value\n</td>\n</tr>\n");

    }



    }



    echo ("</table><hr width=100% noshade>");



    }



    ELSE

    {

    $end = $end - 1;

    }



    $count = $count - 1;



    }





    $entryid = "entry" . $count;



    IF ($start != $lastentry)

    {

    $start = $start + $maxperpage;

    echo (" <A HREF=\"$PHP_SELF?start=$start\"><<< Indietro</a>");

    echo (" ");

    }





    IF (isset($$entryid))

    {

    echo (" ");

    echo (" <A HREF=\"$PHP_SELF?start=$count\">Avanti >>></a>");

    }





    echo ("

    <A HREF=\"$PHP_SELF?add=true\">Inserisci un messaggio</a> ");


    }



















    ELSE IF (isset($add))

    {

    echo ("$addform");

    }



















    ELSE IF (isset($addsubmit))

    {



    $required = Array (

    'Nome' => $name,

    'E-Mail' => $email,

    'Messaggio' => $message);



    while (list($caption, $variable) = each($required))

    {

    $errorcount = 0;



    IF ($variable == "")

    {

    ++$errorcount;

    echo ("Il campo obbligatorio '$caption' è stato lasciato bianco.
    ");

    }



    }







    IF ($errorcount == 0)

    {



    $filename = "entrycounter.inc";



    $increment = $lastentry + 1;



    $incrementoutput = "<? $" . "lastentry = " . $increment . "; ?>";



    $write = fopen($filename, "w");

    fwrite ($write, $incrementoutput);

    fclose($write);



    $entryid = "entry" . $increment;



    $datetime = date ("l F jS @ g:iA T");





    $addentry = "<? $" . $entryid .

    " = Array ( " .

    "'Nome' => '$name', " .

    "'E-Mail' => '$email', " .

    "'Postato il' => '$datetime', " .

    "'Messaggio' => '$message'); ?>";



    $filename2 = "entries.inc";



    $write2 = fopen($filename2, "a");

    fwrite ($write2, $addentry . "\r\n\r\n");

    fclose($write2);



    echo ("Grazie per aver inserito il messaggio.

    <A HREF=\"$PHP_SELF\">Clicca qui</a> per vedere tutti i messaggi.
    ");





    }





    ELSE

    {

    echo ("

    <font color=\"red\">Devi riempire i campi mancanti</font>");

    }



    }



    ?>

  2. #2
    Utente di HTML.it L'avatar di LA VALE
    Registrato dal
    Sep 2003
    Messaggi
    667
    UP!!!

  3. #3
    non si capisce niente... non potevi linkare un txt?

  4. #4

  5. #5
    Utente di HTML.it L'avatar di LA VALE
    Registrato dal
    Sep 2003
    Messaggi
    667
    ari-up...

    Non mi aiuta nessuno?

  6. #6
    questo script qui è ULTRA vecchio

    scaricane uno + aggiornato
    (guarda la firma di mjguest ^^)

  7. #7
    Utente di HTML.it L'avatar di LA VALE
    Registrato dal
    Sep 2003
    Messaggi
    667
    a me serve un guestbook senza data base

  8. #8
    Originariamente inviato da LA VALE
    a me serve un guestbook senza data base
    achims, oppure cerca tra quelli che ho installato in freephp, ce ne dev'essere uno buono, ma non ricordo il nome.

  9. #9
    Utente di HTML.it L'avatar di LA VALE
    Registrato dal
    Sep 2003
    Messaggi
    667
    manca una cosa fondamentale: il link in cui trovare gli script..

  10. #10

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 © 2024 vBulletin Solutions, Inc. All rights reserved.