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

    questo script non mi funziona

    ho scaricato questo script per creare una chat ma non capisco come configurarlo la cartella contiene due file uno php con lo script seguente:

    <?php
    // --------------------------------------------------------
    // PHP Chat v002a
    // Written by Maxime Labelle - info@vt220.com
    //
    // Will write chat into file chat.txt (Must be chmod 777)
    // - Support diffrent file names
    // - Support variable number of line display
    // - Strip HTML code
    //
    // http://www.vt220.com
    // --------------------------------------------------------
    // SETTINGS

    $admin_pwd="vinarcid"; // Admin password !! CHANGE THIS
    // or it will NOT work..

    $me="phpchat.php"; // This file name (important)

    $room="magiccup"; // Chat room name

    $file_name="chat.db"; // File name of the database

    $number_of_lines="100"; // Number of line to display in window

    $strip_html="1"; // Set this to 0 if you want to
    // allow users to use HTML code
    // in the chat window (NOT GOOD)

    $window_width="600"; // You should not change this
    $window_height="250"; // if you are not an expert..

    // --------------------------------------------------------
    // DO NOT EDIT BELOW THIS LINE
    // --------------------------------------------------------
    if (!file_exists("$file_name")) {
    $fp=fopen($file_name,"w");
    fputs($fp,""); // create empty file
    fclose($fp); // close file pointer
    }

    if ($refresh == "") { $refresh=3; }
    if ($refresh == "0") { $selected[0]=selected; }
    if ($refresh == "1") { $selected[1]=selected; }
    if ($refresh == "2") { $selected[2]=selected; }
    if ($refresh == "3") { $selected[3]=selected; }
    if ($refresh == "4") { $selected[4]=selected; }
    if ($refresh == "5") { $selected[5]=selected; }
    if ($refresh == "6") { $selected[6]=selected; }
    if ($refresh == "10") { $selected[7]=selected; }
    if ($refresh == "99999") { $selected[8]=selected; }

    if ($nick == "") { $nick="guest"; }
    if ($nick != "" && $text != "" && $nick != " " && $text != " ") {
    if ($strip_html == "1") {
    $text = str_replace ("|", " ", $text); $nick = str_replace ("|", " ", $nick);
    $text = strip_tags($text); $nick = strip_tags($nick);
    $text = stripslashes($text); $nick = stripslashes($nick);
    }
    $fp=fopen($file_name,a); $suc=fputs($fp, "<$nick> $text
    \n"); $suc=fclose ($fp);
    }

    if ($mode == "chat") {
    echo "<html><head><title></title><META HTTP-EQUIV=refresh CONTENT=\"";
    echo $refresh; echo ";URL="; echo $me; echo "?refresh="; echo $refresh;
    echo "&mode=chat\"></head><body bgcolor=cccccc text=000000><font face=verdana size=-1><table border=0 width=90%><tr><td><font face=verdana size=-1><div align=justify>";
    $datapre = file("$file_name"); $rows = count($datapre); $y=0;
    for($x=$rows;($x>=0 && $y<=$number_of_lines);$x--) {
    $data = explode("¦¦",$datapre[$x]); echo "$data[0]";$y++;
    }
    echo "
    </font></td></tr></table></body></html>";
    }
    if ($mode == "showall") {
    echo "<html><head><title></title></head><body bgcolor=cccccc text=000000><div align=center><font face=verdana size=-1>Complete PHP Room message listing...

    <table border=0 width=80%><tr><td><font face=verdana size=-2><div align=justify>";
    include("$file_name");
    echo "
    </font></td></tr></table></body></html>";
    return;
    }
    if ($mode == "admin") {
    if ($pwd == "change_me") { echo "Change the default password, please.."; return; }
    if ($pwd == $admin_pwd) {
    echo "Control Panel will allow you to:
    ";
    echo "- Ban user ip address..
    ";
    echo "- Remove lines..
    ";
    echo "- Clear the room
    ";
    echo "- Change color settings
    ";
    echo "- Change table size settings
    ";
    echo "- Change Chat settings: buffer size, tag stripping, etc..";

    echo "

    <a href=/>Logout</a>"; return;
    }
    if ($pwd != $admin_pwd) {
    echo "

    <div align=center><table width=60% border=1 cellpadding=0 cellspacing=0><tr><td><FORM METHOD=POST \""; echo $PHP_SELF; echo "?mode=admin"; echo "\">";
    echo "
    <div align=center><font face=verdana size=-1>Enter Admin password : <input name=pwd type=password> <input type=submit name=insert value=submit class=button>

    </td></tr></table></div>";
    return;
    }
    }

    if ($mode == "") {
    echo "<div align=center><FORM METHOD=POST \""; echo $PHP_SELF; echo "?nick=";
    echo $nick; echo "\"><table width="; echo $window_width; echo " border=0 cellpadding=0 cellspacing=0><tr><td><div align=center><font face=verdana size=-1>php chat @ ";
    echo $room; echo "
    </div>
    <iframe name=cwindow width="; echo $window_width;
    echo " height="; echo $window_height; echo " src=\"";
    echo $me; echo "?mode=chat&refresh="; echo $refresh; echo "&nick="; echo $nick;
    echo "\"></iframe><table width=100% border=0><tr><td><font face=verdana size=-1>";
    $lines = count(file($file_name));
    echo ""; echo $lines; echo " messages in <a href="; echo $me;
    echo "?mode=showall target=_blank>"; echo "room</a>.
    | <a href=";
    echo $me; echo "?mode=admin target=_blank>login</a>";
    echo "</td><td><div align=right><font face=verdana size=-1>speed ";
    echo "<SELECT NAME=refresh SIZE=1 class=choice><OPTION VALUE=0 "; echo $selected[0];
    echo ">fastest<OPTION VALUE=1 "; echo $selected[1]; echo ">Very fast<OPTION VALUE=2 "; echo $selected[2];
    echo ">Fast<OPTION VALUE=3 "; echo $selected[3]; echo ">Normal<OPTION VALUE=4 "; echo $selected[4]; echo ">slow<OPTION VALUE=5 "; echo $selected[5]; echo ">more slow<OPTION VALUE=6 "; echo $selected[6];
    echo ">very slow<OPTION VALUE=10 "; echo $selected[7]; echo ">slowest<OPTION VALUE=99999 "; echo $selected[8]; echo ">off</SELECT>";
    echo "</div></td></tr></table><table border=0 width=100%><tr><td><font face=verdana size=-2><</td><td><input type=text value=";
    echo $nick; echo " name=nick size=8 class=form MAXLENGTH=8><font face=verdana size=-2> ></td><td><font face=verdana size=-2>:</td><td><div align=center><input type=text name=text size=50 class=form MAXLENGTH=128></td><td><div align=right><input type=submit name=insert value=send. class=button> <input type=reset name=Clear_form value=clear. class=button></td></tr></table></form></td></tr></table></center>";
    }
    ?>


    ED UN file readme KE dice quanto segue:

    ```'`'`'`'`''`''```'''`''`'`````''`''`'```'`'`'`'' `'`'``
    PHP Chat - version 002a
    By Maxime Labelle - info@vt220.com

    http://www.vt220.com

    ```'`'`'`'`''`''```'''`''`'`````''`''`'```'`'`'`'' `'`'``

    >> INSTALLATION
    Just put the tag <?PHP include("phpchat.php"); ?> in your
    html file and it will work. Make sure the file used for
    the database are writable, if not sure please do

    IMPORTANT: Please change the admin password, just open
    and edit the file phpchat.php and change it.

    # chmod 777 <chat_file_name.db>
    ex: chmod 777 chat.db

    >> EYE-CANDY
    If you want to have a nice chat input box and submit buttons
    insert this code right after your </TITLE> tag in the html
    file, like this:

    #~#~#~#~#~#~#~# STYLE SHEET FOR THE FORM IN PHP CHAT #~#~#~#~#~#~#~#

    </TITLE><STYLE type=text/css>
    INPUT.form {
    BACKGROUND-COLOR: #666666; BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; COLOR: #ffffff; FONT-FAMILY: verdana, tahoma, arial; FONT-SIZE: 8pt;
    }
    INPUT.button {
    BACKGROUND-COLOR: #FF6600; BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; COLOR: #ffffff; FONT-FAMILY: verdana, tahoma, arial; FONT-SIZE: 11px; FONT-WEIGHT: bold
    }
    SELECT.choice {
    BACKGROUND-COLOR: #666666; BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; COLOR: #ffffff; FONT-FAMILY: verdana, tahoma, arial; FONT-SIZE: 8pt
    }
    </style>

    #~#~#~#~#~#~#~# STYLE SHEET FOR THE FORM IN PHP CHAT #~#~#~#~#~#~#~#

    Change the colors if you want !

    >> CONFIGURATION
    Just open/edit the file phpchat.php and edit the variables
    under the SETTINGS header..

    >> ABOUT
    Was written by Maxime Labelle - info@vt220.com
    for fun, because I felt like it, no reasons, works nice too..thanks
    to Silicon Ghost for some snipplets, nothing serious here, its GPL
    too, so use this code as you want...

    Maxime Labelle
    email: info@vt220.com
    web: http://www.vt220.com

    ```'`'`'`'`''`''```'''`''`'`````''`''`'```'`'`'`'' `'`'``

    http://www.vt220.com

  2. #2

  3. #3
    ragazzi ma č possibile ke post il tutte le sezione del forum e ce subito qualke ragazzo disposto ad aiutarmi, mentre da queste parti non se ne parla proprio??????

    non penso di kiedervi cose dell'altro mondo ma solo di configurare questo benedetto file GRAZIEEEEE

  4. #4
    Originariamente inviato da vinarcid0810
    ragazzi ma č possibile ke post il tutte le sezione del forum e ce subito qualke ragazzo disposto ad aiutarmi, mentre da queste parti non se ne parla proprio??????

    non penso di kiedervi cose dell'altro mondo ma solo di configurare questo benedetto file GRAZIEEEEE
    Credo che il tuo script sia piuttosto datato. E' pieno di NOTICE e per debugarlo bisognerebbe rivederlo in toto.

    nel suo sito funziona con:

    Server: Apache/1.3.31 (Unix) mod_ssl/2.8.18 OpenSSL/0.9.6b
    X-Powered-By: PHP/4.3.3

    http://www.vt220.com/virtualphpchat.php

    Se vuoi vederlo funzionare dovresti mettere nel file php.ini:

    error_reporting = E_ALL & ~E_NOTICE
    register_globals = ON

    e dopo di che restartare apache.

    Oppure rivedere pesantemente lo script.

    Ciao



    edit: dimenticavo.... il pannello dell'admin, non esiste... stampa solo l'elenco delle cose che potrebbe fare, ma non c'e' lo script per farle.

    Il silenzio č spesso la cosa migliore. Pensa ... č gratis.

  5. #5
    Originariamente inviato da vinarcid0810
    ragazzi ma č possibile ke post il tutte le sezione del forum e ce subito qualke ragazzo disposto ad aiutarmi, mentre da queste parti non se ne parla proprio??????

    non penso di kiedervi cose dell'altro mondo ma solo di configurare questo benedetto file GRAZIEEEEE


    forse perchč spiegare il php a chi lo conosce poco non č come correggere una tabella in html?
    w la topa

  6. #6
    ragą allora voi cosa mi consigliate o meglio ke script usare mi date qualke link magari ke non sia necessario usare mysql ciaooooo aspetto vs notizie

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.