El codigo del chat
Código
<?php //Mini Chat 0.3 //Coded By Doddy H //Datos del a DB $host = "localhost"; $user = "root"; $pass = ""; $db = "chat"; // //Colores $fondo = "black"; $color = "#00FF00"; // echo " <style> .main { word-wrap: break-word; word-break:break-all; margin : -287px 0px 0px -490px; border : White solid 1px; BORDER-COLOR: $color; background-color:$fondo; color:$color; } .otro { background-color:$fondo; color:$color; BORDER-COLOR: $color; } </style>"; echo "<table border=0 width='210' style='table-layout: fixed'>"; echo "<td class=main><b>Mini Chat 0.3</b></td><tr class=main>"; foreach ($s as $d) { $total = $d; } $test = $total - 10; if ($test <= 0) { next; } else { $resto = $test; for ($i = 1; $i <= $resto; $i++) { } } echo "<td class=main><b>".$ver[2]."</b>:".$ver[1]."</td><tr class=main>"; } echo "<br><br><td class=main><br><b>Dejar mensaje</b><br><br> <form action='' method=POST> Apodo : <input class=otro type=text name=apodo size=25><br> Texto : <input class=otro type=text name=msg size=25><br><br> <input class=otro type=submit name=chatentro value=Mandar> </form> <tr> <td class=main><b>Coded By Doddy H</b></td><tr class=main> </table>"; foreach ($s as $d) { $x_id = $d+1; } } @mysql_query("INSERT INTO mensajes(id_comentario,apodo,mensaje)values('$x_id','$apodo','$mensaje')"); echo '<meta http-equiv="refresh" content=0;URL=>'; } // The End ? ?>
El administrador.
Código
<?php //Mini Chat 0.3 Admin //Datos para el login $username = "admin"; $password = "21232f297a57a5a743894a0e4a801fc3"; //admin // //Datos para la DB $host = "localhost"; $userw = "root"; $passw = ""; $db = "chat"; // $user = $plit[0]; $pass = $plit[1]; if ($user == $username and $pass == $password) { echo "<title>Mini Chat 0.3</title>"; $todo = "create table mensajes ( id_comentario int(10) UNSIGNED NOT NULL AUTO_INCREMENT, mensaje TEXT NOT NULL, apodo VARCHAR(255) NOT NULL, PRIMARY KEY (id_comentario)); "; $todo2 = "create table insultos ( id_insulto int(10) UNSIGNED NOT NULL AUTO_INCREMENT, mensaje TEXT NOT NULL, PRIMARY KEY (id_insulto)); "; foreach ($insultos as $con) { } echo "<script>alert('Instalado correctamente');</script>"; echo '<meta http-equiv="refresh" content=0;URL=>'; } } else { echo "<script>alert('Error');</script>"; } } // echo "<script>alert('Comentario borrado');</script>"; } else { echo "<script>alert('Error');</script>"; }}} echo "<center><h2>Comentarios encontrados</h2><br><br>"; echo "<table border=1>"; echo "<td><b>ID</b></td><td><b>Apodo</b></td><td><b>Texto</b></td><td><b>Opcion</b></td><tr>"; echo "<td>".htmlentities($ver[0])."</td><td>".htmlentities($ver[2])."</td><td>".htmlentities($ver[1])."</td><td><a href=?id=".htmlentities($ver[0]).">Borrar</a></td><tr>"; } echo "</table>"; $in = $_POST['insul']; } echo "<script>alert('Insulto borrado');</script>"; } else { echo "<script>alert('Error');</script>"; }}} echo "<br><br><h2>Bloqueo de insultos</h2><br><br>"; echo " <form action='' method=POST> Texto : <input type=text name=insul> <input type=submit name=nuevoinsulto value=Agregar> </form>"; echo "<br><br><h2>Insultos encontrados</h2><br><br>"; echo "<table border=1>"; echo "<td>ID</td><td>Insulto</td><td>Opcion</td><tr>"; echo "<td>".htmlentities($ver[0])."</td><td>".htmlentities($ver[1])."</td><td><a href=?delpu=".htmlentities($ver[0]).">Borrar</a></td><tr>"; } echo "</table>"; echo "</center>"; } else { echo " <center><br><br> <form action='' method=POST> <h2>Deseas instalar Mini Chat 0.3 ?</h2><br><br> <input type=submit name=instalar value=Instalar> </form>"; } } } echo "<script>alert('Bienvenido idiota');</script>"; echo '<meta http-equiv="refresh" content=0;URL=>'; } else { echo "<script>alert('Segui Participando');</script>"; } } else { echo " <title>Mini Chat 0.3</title> <h1><center>Mini Chat 0.3</center></h1> <br><br><center> <form action='' method=POST> Username : <input type=text name=user><br> Password : <input type=text name=password><br><br> <input type=submit name=login value=Enter><br> </form> </center><br><br>"; } // The End ? ?>