Ir para conteúdo
Fórum Script Brasil
  • 0

Entrem Por Favor! Please!


BEOC

Pergunta

5 respostass a esta questão

Posts Recomendados

  • 0

O meu código é este:

index.php

<html>

<head>

<title>Creed Chat</title>

<meta http-equiv="Pragma" content="no-cache">

</head>

<body bgcolor="#000000">

<p align="center"><img src="http://chatcreed.webcindario.com/logo.jpg" border="0"></p><BR>

<form method="post" action="entra.php" name="frmEntra">

  <p align="center"><b><font color="#FFFFFF">Escolha seu apelido</font></b></p>

  <p align="center"><input type="text" name="valor" size="31"></p>

  <p align="center"><input type="submit" value="Entrar" name="B1"></p>

</form>

</body>

</html>

form.php

<html>

<head>

<meta http-equiv="Pragma" content="no-cache">

</head>

<body>

<table width="100%" cellpadding="0" cellspacing="0" border="1" bordercolor="#000000">

  <tr>

        <td align="center">

          <form action="lform.php" method="post" name="frmMsg">

                <table width="600" border="0">

                  <tr>

          <td><b><i>

                <?php echo $nome; ?>

                </i></b>

            <p>

                                        <select size="1" name="dest">

                                <option selected>TODOS</option>

<?php

$arq="log.txt";

$fd = fopen ($arq, "r");

$i=0;

while (!feof ($fd)) {

    $buffer = fgets($fd, 4096);

    $pieces = explode("|",$buffer);

    $reg[$i] =$pieces[0];

    $i++;

}

fclose ($fd);

for($k=0;$k < ($i-1);$k++){

    $comp=$reg[$k];

    for($j=$k+1;$j < $i;$j++){

        if($comp==$reg[$j]){$reg[$j]="";}

    }

}

for($s=0;$s < $i;$s++){

    $x=$reg[$s];

    if ($x !="") {

        echo "<option value=\"$x\">$x</option>";

    }

}

?>

                          </select><input size="44" name="msg"><input type="submit" value="Enviar" name="Enviar">

            </p>

</td>

        </tr>

  </table>

</form>

</td></tr>

</table>

</body>

</html>

entra.php

<?php

session_start();

session_register("nome");

$nome=$valor;

?>

<html>

<head>

</head>

<body bgcolor="#FFFFFF">

<script>

window.open('chat.htm', 'chat', 'toolbar=no,location=no,status=no,menubar=no,width=700,height=500');

window.close()

</script>

</body>

</html>

ler.php

<?php

session_start();

include ("./user.php");

echo '<html><head><meta http-equiv="Refresh" content="5"></head><body>';

$arq="reg.txt";

$fd = fopen ($arq, "r");

while (!feof ($fd)) {

    $buffer = fgets($fd,4096);

    echo $buffer;

}

fclose ($fd);

?>

</body>

</html>

lform.php

<?php

session_start();

$mesg="<p>$nome fala para $dest : $msg</p>\n\n";

$arq="reg.txt";

$i=0;

$fd = fopen ($arq, "r");

while (!feof ($fd)) {

    $buffer = fgets($fd, 500);

    $reg[$i] =$buffer;

    $i++;

}

fclose ($fd);

$fp_a=fopen($arq,"w");

for($k=0;$k < $i;$k++){

    fputs($fp_a,$reg[$k]);

}

fputs($fp_a,$mesg);

fclose($fp_a);

echo "<html><head>";

echo "<meta http-equiv=\"Refresh\" ";

echo "content=\"0;url=form.php\">";

echo "</head></html>";

?>

topo.php

<html>

<head>

<title>Creed Chat</title>

</head>

<body>

<p align="center"><img src="http://chatcreed.webcindario.com/logo.jpg" border="0"></p>

<br>

<p align="left">Seja Bem Vindo <? echo $nome; ?> a nossa sala de chat!</p>

</body>

</html>

user.php

<?php

$timer = 1;

$filename = "log.txt";

if (!$datei) $datei = dirname(__FILE__)."/$filename";

$time = @time();

$ip = $nome;

$string = "$ip|$time\n";

$a = fopen("$filename", "a+");

fputs($a, $string);

fclose($a);

$timeout = time()-(60*$timer);

$all = "";

$i = 0;

$datei = file($filename);

for ($num = 0; $num < count($datei); $num++) {

    $pieces = explode("|",$datei[$num]);

    if ($pieces[1] > $timeout) {

        $all .= $pieces[0];

        $all .= ",";

    }

    $i++;

}

$all = substr($all,0,strlen($all)-1);

$arraypieces = explode(",",$all);

$useronline = count(array_flip(array_flip($arraypieces)));

$dell = "";

for ($numm = 0; $numm < count($datei); $numm++) {

    $tiles = explode("|",$datei[$numm]);

    if ($tiles[1] > $timeout) {

        $dell .= "$tiles[0]|$tiles[1]";

    }

}

if (!$datei) $datei = dirname(__FILE__)."/$filename";

$time = @time();

$ip = $nome;

$string = "$dell";

$a = fopen("$filename", "w+");

fputs($a, $string);

fclose($a);

?>

chat.htm

<html>

<head>

<title>Creed Chat</title>

<meta http-equiv="Pragma" content="no-cache">

</head>

<frameset rows="*,109" frameborder="no" border="0" framespacing="0">

  <frame name="topo" src="topo.php" scrolling="no">

  <frame name="meio" src="ler.php">

  <frame name="parte inferior" scrolling="no" noresize src="form.php">

  <noframes>

  <body>

  <p>Esta página usa quadros mas seu navegador não aceita quadros.</p>

  </body>

  </noframes>

</frameset>

</html>

Gente não copiem tá só me ajudem! sad.gif

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...