{help}problem with rgister page...

Newbie Spellweaver
Joined
Jan 11, 2007
Messages
33
Reaction score
0
im use this script

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style>
<!--
body,td,th {
    color: #A0A0A4;
    font-family: Times New Roman, Times, serif;
    font-size: 14px;
}
body {
    background-color: #2A3F55;
}
a:link {
    color: #FFFBF0;
    text-decoration: none;
}
a:visited {
    color: #FFFBF0;
    text-decoration: none;
}
a:hover {
    color: #FFFBF0;
    text-decoration: underline;
}
a:active {
    color: #FFFBF0;
    text-decoration: none;
}
input {
    border: 1px solid #A0A0A4;
    color: #808080;
    background: #2A3F55; 
    font-family: Verdana, Arial, Serif;
    font-size: 10pt;
    text-decoration:blink
}
.Estilo1 {
    font-family: Silkscreen;
    font-size: 16px;
}
.Estilo2 {font-size: 36px}
.Estilo3 {font-size: 12px}
</style>
<title>Documento sin título</title>
</head>
 
<body>
<FORM METHOD=POST ACTION="<?php echo $_SERVER['PHP_SELF']; ?>?hacer=registrarmebyDaRIo">
<table width="347" border="0" align="center">
  <tr>
    <td align="right">Usuario</td>
    <td><input name="usuario" type="text" id="usuario" /></td>
  </tr>
  <tr>
    <td align="right">Contraseña</td>
    <td><input name="pass" type="text" id="pass" /></td>
  </tr>
  <tr>
    <td align="right">Repetir Contraseña </td>
    <td><input name="repetir" type="text" id="repetir" /></td>
  </tr>
  <tr>
    <td width="165" align="right">Email</td>
    <td width="166"><input name="email" type="text" id="email" /></td>
  </tr>
</table>
<table width="347" border="0" align="center">
  <tr>
    <td align="center" valign="middle"><input type="submit" name="Submit" value="Registrar cuenta" /></td>
  </tr>
  <tr>
    <td><span class="Estilo1 Estilo2">
<?php
$srvip = "127.0.0.1";
$srvport = "6000";
$mssql_user = "";
$mssql_pass = "";
$mssql_database = "GunZDB";
$mssql_host = "";
$conn = mssql_connect($mssql_host, $mssql_user, $mssql_pass);
mssql_select_db($mssql_database);
?>
<?php 
 
    if ($_GET['hacer'] == 'registrarmebyDaRIo')
{
    $user = anti_injection($_POST['usuario']);
    $pass1 = anti_injection($_POST['pass']);
    $pass2 = anti_injection($_POST['repetir']);
    $email = anti_injection($_POST['email']);
    if (valida(Array($user,$pass1,$pass2,$email)) == true)
    {
        if ($pass1 == $pass2)
        {
            if (ereg("([0-9,a-z,A-Z])", $user))
            {
                if (ereg("^([0-9,a-z,A-Z]+)([.,_]([0-9,a-z,A-Z]+))*[@]([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[.]([0-9,a-z,A-Z]){2}([0-9,a-z,A-Z])?$", $email))
                {
                    $query = mssql_query("SELECT * FROM Accounts WHERE UserID='$user'");
                    $num_rows = mssql_num_rows($query);
                    if ($num_rows == 0)
                    {
                        $query = mssql_query("SELECT * FROM Accounts WHERE E_Mail='$email'");
                        $num_rows = mssql_num_rows($query);
                        if ($num_rows == 0)
                        {
                            $query = mssql_query("INSERT INTO Accounts (UserID, Password, E_Mail) VALUES ('$user','$pass1','$email')");
                            if (!$query)
                            {
                                echo "Error, try again later.";
                            }
                            else
                            {
                                echo "Account registered!.";
                            }
                        }
                        else
                        {
                            echo "Email in use.";
                        }
                    }
                    else
                    {
                        echo "User in use.";
                    }
                }
                else
                {
                    echo "Invalid Email.";
                }
            }
            else
            {
                echo "You just can use numbers and letters like username.";
            }
        }
        else
        {
            echo "Password doesnt matchs!";
        }
    }
}
 
function anti_injection($sql)
{
$sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql);
$sql = trim($sql);
$sql = strip_tags($sql);
$sql = addslashes($sql);
return $sql;
}
 
 
function valida($campos){
  foreach($campos as $c){
      if(empty($c)){
        echo "Please complete all fields.";
        return false;
      }else{
        return true;
      }
  }
}
?></td>
  </tr>
  <tr>
    <td align="center">Script Creado por DaRIo para Xtasy-Games.com </td>
  </tr>
</table>
<p> </p>
</body>
</html>

the page started but i prees rgister i got error "the page not found"

u can see thet in my reg page: gunzwar.no-ip.biz

pls some1 can tell me what is my problem?

or give me new scripit web page?

thx
 
Yeah, that is my script. Taken from XG. There isnt a error in the script. But when i visited your website i see a CGI problem ¬¬
 
Upvote 0
Back