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

    Replica aiuto php grazie

    Per cortesia, nel mio sito web ho inserito un Guest-book, nel mio computer sul server locale funziona tutto, ma in rete funziona sola la visualizzazione e non riesco a far memorizzare i dati dell’utente tramite modulo nel file. Ho provato con moltissimi esempi messi a disposizione da html.it ma niente da fare. Il contatore messo a disposizione da aruba.it funziona, cosa succede? Il mio server è Aruba.it. hosting Lin./Windows
    Se volete provarlo ecco l’indirizzo http:// www.amatoribiancade.it/index.php?sezione=ware_gb
    Grazie
    Questo è il codice php
    Guest-book
    code
    <?
    /* Customization Variables */

    // Your web site address
    $yoursiteaddress = "http://www.amatoribiancade.it";

    // Your web site name
    $yoursitename = "www.amatoribiancade.it";

    // Max entries per page
    $maxperpage = "15";

    // Allow HTML in guestbook submissions? (0 = No, 1 = Yes)
    $allowhtml = "1";

    $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\">[b]Nome:</td>\n";
    $addform .= "<td width=\"400\"><input type=\"text\" name=\"name\"></td>\n";
    $addform .= "</tr><tr>\n";
    $addform .= "<td width=\"100\">[b]E-Mail:</td>\n";
    $addform .= "<td width=\"400\"><input type=\"text\" name=\"email\"></td>\n";
    $addform .= "</tr><tr>\n";
    $addform .= "<td width=\"100\">[b]Sito Web:</td>\n";
    $addform .= "<td width=\"400\"><input type=\"text\" name=\"siteurl\" value=\"http://\"></td>\n";
    $addform .= "</tr><tr>\n";
    $addform .= "<td width=\"100\">[b]Messaggio:</td>\n";
    $addform .= "<td width=\"400\"><TEXTAREA name=\"message\" cols=\"30\" rows=\"10\"></TEXTAREA></td>\n";
    $addform .= "</tr><tr>\n";
    $addform .= "<td width=\"100\"></td>\n";
    $addform .= "<td width=\"400\"><input type=\"submit\" value=\"Inserire messaggi\">\n";
    $addform .= "</tr></table>\n";
    $addform .= "</FORM>\n";

    include ("header.inc");
    include ("cgi-bin/entries.dat");
    include ("entrycounter.inc");

    IF (!isset($add) and !isset($addsubmit))
    {
    ?>
    <html>
    <a onclick="window.open('gino', 'external', 'width=450,height=400')" target="external" href="ware_gb.php?add=true">
    Inserisci commento
    </a>
    </html>
    <?

    $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 == "Site URL")
    {
    echo ("<tr>\n<td width=100>\n$variable:\n</td>\n<td width=400>\n<A HREF=\"$value\">$value</a>\n</td>\n</tr>\n");
    }

    ELSE IF ($variable == "Message")
    {
    $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\"><<< Back</a>");
    echo (" ");
    }


    IF (isset($$entryid))
    {
    echo (" ");
    echo (" <A HREF=\"$PHP_SELF?start=$count\">Next >>></a>");
    }

    ?>
    <html>
    <a onclick="window.open('mauro', 'external', 'width=450,height=400')" target="external" href="ware_gb.php?add=true"><center>
    Inserisci commento
    </a>
    </html>
    <?

    }
    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 ("Campo Richiesto '$caption' Spazio vuoto.
    ");
    }

    }

    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', " .
    "'Data' => '$datetime', " .
    "'Sito Internet' => '$siteurl', " .
    "'Messaggio' => '$message'); ?>";

    $filename2 = "cgi-bin/entries.dat"; // questo è il file in questione in cui vengono memorizzati i dati //
    $write2 = fopen($filename2, "a");
    fwrite ($write2, $addentry . "\r\n\r\n");
    fclose($write2);
    echo ("[b]Grazie, il vostro commento è stato inserito.

    Se lo velete vedere visualizzato clicca[b]</p>Qui</p><INPUT class=button onclick=javascript:window.close() type=submit
    value= Chiudi style=border-style:solid; border-width:0; padding:0; float: center; font-family:Verdana; font-size:8 pt; font-weight:bold; background-color:#00F2F2>");
    }
    ELSE
    {
    echo ("

    <font color=\"red\">[b]<a href=ware_gb.php?add=true>
    Indietro</a>
    </font>");
    }

    }

    include ("footer.inc");

    ?>
    fine code

  2. #2
    Utente di HTML.it L'avatar di kodode
    Registrato dal
    Sep 2002
    Messaggi
    1,896
    domanda banale tu hai i permessi per scrivere?? hai fatto qualche prova con PHPMuAdmin?? riporta l'errore che ti da...

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.