Autor Tema: Censurar caracteres al minichat de RamFu v3  (Leído 610 veces)

Desconectado Navarro

  • PHPerit@
  • *
  • Mensajes: 45
  • Karma: 1
  • Sexo: Masculino
    • Ver Perfil
    • HabboLands
Censurar caracteres al minichat de RamFu v3
« en: 07 de Mayo de 2009, 22:53:44 pm »
Hola a todos. Aqui os dejo mi catalogo/index.php, con los caracteres ''<'' y ''>'' censurados.

Código: [Seleccionar]
<html>
<title>Registro RamFu V3</title>
<link REL="STYLESHEET" HREF="estilo.css" TYPE="text/css">
<style type="text/css">
<!--
body {
background-image: url(../img/bg.png);
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.Estilo1 {
font-family: Tahoma;
font-weight: bold;
}
.Botoon {
background:none;
position:relative;
border:none;
}
#tagging-game {
    padding: 10px;
}
-->
</style>
<head>
<link href="../styles/buttons.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF">
<center>
  <table width="161" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="161"><img src="../img/vip_up.png" width="161" height="26"></td>
    </tr>
    <tr>
      <td background="../img/vip_middle.png">
    <div align="center"><font color="#000000" size="-3" face="Tahoma"><b>
      </b></font>
      <table width="148" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="148"><div align="center" class="Estilo1">
                <font color="#000000" size="1">
                <?
include('../conectar.php');
$cons = mysql_query("SELECT * FROM usuarios WHERE rol='0' ");
$numsss = mysql_num_rows($cons);
if($numsss >= "12000") {
echo'
<font color="red" size="2">ERROR: Hay m&aacute;s de 12000 Vips y este script est&aacute; predefinido a unicamente 400 Vips.<br>
 No se agregaran m&aacute;s a no ser que los managers lo agreguen desde el panel.<br>
 Perdone las molestias.</font>
';
} else {
if($_POST['b1']) {
$nick = $_POST[n];
$email = $_POST[e];
$pass = md5($_POST[p]);
$fecha = date("d.m.Y , H:i:s");
$rol = "0";
$habbo = $_POST[habbo];
if($email == "" or $nick == "" or $pass == "" or $habbo == "") {
  echo"ERROR: Necesitas insetar todos los campos. <br><a href='index.php'>Volver atr&aacute;s</a>";
exit;
}
if (strstr($nick,"<")) {
  echo"ERROR: No puedes introducir el signo "<" en ningún campo. <br><a href='index.php'>Volver atr&aacute;s</a>";
exit;
}
if (strstr($email,"<")) {
  echo"ERROR: No puedes introducir el signo "<" en ningún campo. <br><a href='index.php'>Volver atr&aacute;s</a>";
exit;
}
if (strstr($habbo,"<")) {
  echo"ERROR: No puedes introducir el signo "<" en ningún campo. <br><a href='index.php'>Volver atr&aacute;s</a>";
exit;
}
$con = mysql_query("SELECT count(id) FROM usuarios WHERE nick='$nick' OR email='$email'") ;
if(mysql_result($con,0,0)) {
echo '<font face=tahoma size=2 color=#0000000>Tu nick/email ya ha sido registrado en nuestra base de datos. Haz click <a href="javascript:history.back()">aqu&iacute;</a> para regresar.</font>' ;
exit;
}
else {
mysql_query("INSERT INTO usuarios (nick,rol,pass,email,habbo) VALUES ('$nick','$rol','$pass','$fecha','$habbo')");
mysql_query("INSERT INTO placas (user,puesta) VALUES ('$nick','1')");
mysql_query("INSERT INTO placas (user,placa,nombre,descripcion) VALUES ('$nick','placas/Afan.gif','Fan N.1','Para los fans Nº1 de la web!')");
mysql_query("INSERT INTO placas (user,placa,nombre,descripcion) VALUES ('$nick','placas/Aclub3a.gif','Placa MC de oro','Para los usuarios que quieran ser un poco más exclusivos.')");
echo '<font face=tahoma size=2 color=#0000000>Se ha registrado perfectamente porfavor logueese en el minichat con la password(contrase&ntilde;a) que ha puesto.  <br><br>  <a href="javascript:window.close()">Cerrar</a>
</font>' ;
}
} else {
  ?>
              </font></div></td>
            </tr>
          </table>
        </div>
    <form method='POST'>
        <div align="center"><font color="#000000" size="1" face="Verdana"><b> Nick en el MiniChat:<br>
              <input name="n" type="text" class="Campo">
              <br>
              Nick en Habbo: <br>
            <input name="habbo" type="text" class="Campo" id="habbo" maxlength="25">
            <br>
            Contrase&ntilde;a:<br>
            <input type="password" class="Campo" name="p">
            <br>
            E-mail:<br>
            <input type="text" class="Campo" name="e">
            <br>
        </b></font><br>
        <table width="32%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><input name="b1" type="submit" id="b1" value="Enviar"></td>
          </tr>
        </table>
        </div>
        </form><?
}
}
?></td>
    </tr>
    <tr>
      <td><img src="../img/vip_donw.png" width="161" height="26"></td>
    </tr>
  </table>
  <span class="Campo">Creado por RamFu </span>
</center>


</body>
</html>

Desde que censure los caracteres, ''<'' y ''>'', no eh vuelto a tener ningun problema con nadie.
Saludos
PD: Gracias a CROMINO, que fué quien me lo apaño. xD

Comunidad PHPeros

Censurar caracteres al minichat de RamFu v3
« en: 07 de Mayo de 2009, 22:53:44 pm »