SA-MP Forums Archive
[Ayuda]Necesito ayuda con Registro PHP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [Ayuda]Necesito ayuda con Registro PHP (/showthread.php?tid=464868)



[Ayuda]Necesito ayuda con Registro PHP - bruspup - 19.09.2013

Ise un registro php para un pcu y la contraseсa no la codifica(?



Uso el GM AMRP
y aqui esta el registro en php


PHP код:
<?php 
session_start
(); 
include_once 
"conexion.php"
             
?> 
<style> 
        *{ 
            font-size: 14px; 
            font-family: sans-serif; 
        } 
        form.registro{ 
            background: none repeat scroll 0 0 #F1F1F1; 
            border: 1px solid #DDDDDD; 
            margin: 0 auto; 
            padding: 20px; 
            width: 278px; 
            box-shadow:0px 0px 20px black;  
            border-radius:10px;  
            position:relative; 
            top:30px; 
        } 
        form.registro div { 
            margin-bottom: 15px; 
            overflow: hidden; 
        } 
        form.registro div label { 
            display: block; 
            float: left; 
            line-height: 25px; 
        } 
        form.registro div input[type="text"], form.registro div input[type="Clave"] { 
            border: 1px solid #DCDCDC; 
            float: right; 
            padding: 4px; 
        } 
        form.registro div input[type="submit"] { 
            background: none repeat scroll 0 0 #DEDEDE; 
            border: 1px solid #C6C6C6; 
            float: right; 
            font-weight: bold; 
            padding: 4px 20px; 
        } 
        .error{ 
            color: red; 
            font-weight: bold; 
            margin: 10px; 
            text-align: center; 
        } 
</style> 
<form action="" method="post" class="registro"> 
<div><label>Username:</label> 
<input type="text" name="Username"></div> 
<div><label>Clave:</label> 
<input type="Clave" name="Clave"></div> 
<div><label>Repetir Clave:</label> 
<input type="Clave" name="reClave"></div> 
<div><label>Email:</label> 
<input type="Email" name="Email"></div>
<div> 
<input type="submit" name="enviar" value="Registrar"></div> 
<b>@chucky55</b> 
</form> 
             
<?php 
if(isset($_POST['enviar'])) 

    if(
$_POST['Username'] == '' or $_POST['Clave'] == '' or $_POST['reClave'] == '' or $_POST['Email'] == '' 
    { 
        echo 
'Por favor llene todos los campos.'
    } 
    else 
    { 
        
$sql 'SELECT * FROM cuentas'
        
$rec mysql_query($sql); 
        
$verificar_Username 0
  
        while(
$result mysql_fetch_object($rec)) 
        { 
            if(
$result->Username == $_POST['Username']) 
            { 
                
$verificar_Username 1
            } 
        } 
  
        if(
$verificar_Username == 0
        { 
            if(
$_POST['Clave'] == $_POST['reClave']) 
            { 
                
$Username $_POST['Username']; 
                
$Clave $_POST['Clave']; 
                
$Email $_POST['Email']; 
                
$query ="SELECT username FROM datos WHERE username='$Username'";
                
$sql "INSERT INTO cuentas (Username,Clave,Email) VALUES ('$Username','$Clave','$Email')"
                
mysql_query($sql); 
  
                echo 
'Usted se ha registrado correctamente.'
            } 
            else 
            { 
                echo 
'Las claves no son iguales, intente nuevamente.'
            } 
        } 
        else 
        { 
            echo 
'Este Username ya ha sido registrado anteriormente.'
        } 
    } 

?>



Re: [Ayuda]Necesito ayuda con Registro PHP - Sergio_team - 19.09.2013

El problema esta en que el gamemode AMRP, utiliza una encriptacion, y tu no la encriptas cuando lo insertas,si puede decir que tipo de encriptacion usa cuando crea las cuentas (dentro del gamemode), puede que se te pueda ayudar, si es una encriptacion del propio gamemode (no un MD5, SHA1), se debera hacer una funcion de encriptar en el php con el mismo metodo de encriptar del gamemode.