Ver Mensaje Individual
  #8 (permalink)  
Antiguo 25/07/2010, 15:56
dezagus
 
Fecha de Ingreso: abril-2010
Ubicación: Ping: BSAS - Arg
Mensajes: 791
Antigüedad: 14 años
Puntos: 25
Respuesta: Como Ordenar el Código

Ya lo Resolví, gracias por la Ayuda :D


Código PHP:
<?php

// Conectarse a la Database SQL

include('conec.php');

// Tomar las Variables desde URL

    
$Fname "Test";
    
$Lname "TestApellido";
    
$Mail "[email protected]";
    
$Genere "H";
    
$Host "testehost.com.ar";
    
$Port "3432";
    
$IPOwner "200.192.43.125";
    
$Pay "0";
    
$Method "None";
    
$TimeCreate "21-July-2010";



// Generar Aleatoriamente un Código

function Gen_Cod_Aleatorio()
{
$Usuario "abcdefghjkmnpqrstuvwxyz123456789";
$Aleatorio str_shuffle($Usuario);
$Aleatorio substr($Aleatorio,0,12);
return 
$Aleatorio;
}

$Aleatorio Gen_Cod_Aleatorio();
Gen_Cod_Aleatorio_Verify_User($Aleatorio);

function 
Gen_Cod_Aleatorio_Verify_User($AleaUs){
$wea mssql_query("SELECT UserAcc FROM ActivesAcc where UserAcc ='$AleaUs'");
$row mssql_fetch_row($wea);
if (
$row[0] != ""){ 
Gen_Cod_Aleatorio_Verify_User($Aleatorio);
} else { 
return 
$AleaUs;
}}

$Aleatorio2 Gen_Cod_Aleatorio();
Gen_Cod_Aleatorio_Verify_Pass($Aleatorio2);

function 
Gen_Cod_Aleatorio_Verify_Pass($AleaPass){
$wea mssql_query("SELECT PasswordAcc FROM ActivesAcc where PasswordAcc ='$AleaPass'");
$row mssql_fetch_row($wea);
if (
$row[0] != ""){ 
Gen_Cod_Aleatorio_Verify_Pass($Aleatorio2);
} else { 
return 
$AleaPass;
}}


// Muestra de lo que se Genera y que las Variables son Enviadas.
// $Us = Gen_Cod_Aleatorio_Verify_User($Aleatorio);
// $Ps = Gen_Cod_Aleatorio_Verify_Pass($Aleatorio2);
// echo $Us.'     '.$Ps.'   Esto fue Generado al Azar.';

$UserAcc Gen_Cod_Aleatorio_Verify_User($Aleatorio);
$PasswordAcc Gen_Cod_Aleatorio_Verify_Pass($Aleatorio2);

mssql_query("INSERT INTO ActivesAcc VALUES ('$Fname', '$Lname', '$Mail', '$Genere', '$Host', '$UserAcc', '$PasswordAcc', '$Port', '$IPOwner', '$Pay', '$Method', '$TimeCreate')");


// Mostrar Dátos en la Pantalla
    
    
echo $Fname."<br>";
    echo 
$Lname."<br>";
    echo 
$Mail."<br>";
    echo 
$Genere."<br>";
    echo 
$Host."<br>";
    echo 
$UserAcc."<br>";
    echo 
$PasswordAcc."<br>";
    echo 
$Port."<br>";
    echo 
$IPOwner."<br>";
    echo 
$Pay."<br>";
    echo 
$Method."<br>";
    echo 
$TimeCreate."<br>";
    
// End

?>