Ver Mensaje Individual
  #9 (permalink)  
Antiguo 03/03/2010, 15:50
Avatar de Most
Most
 
Fecha de Ingreso: marzo-2009
Mensajes: 642
Antigüedad: 15 años, 1 mes
Puntos: 6
Respuesta: encriptar clave md5

el iniciando.php es este:

Código PHP:
<?php 

include("config.php"); 

// conectando a basee de datos
$link mysql_connect($server$db_user$db_pass)
or die (
"Error: MYSQL ".mysql_error());

// seleccionando base de datos
mysql_select_db($database)
or die (
"ERROR: MYSQL ".mysql_error());




// biendo en base de datos si estos datos estan

$check "select id from $table where username = '".$_POST['username']."';"
$check "select id from $table where email = '".$_POST['email']."';"
$qry mysql_query($check)
or die (
"ERROR: MYSQL ".mysql_error());
$num_rows mysql_num_rows($qry);  
if (
$num_rows != 0) { 
$mensaje "Ese Usuario o Email ya esta en uso";
echo 
"<script>";
echo 
"alert('$mensaje');";
echo 
"history.back();";
echo 
"</script>";

exit; 

} else {

// metiendo informacion
$insert mysql_query("insert into $table values ('NULL', '".$_POST['username']."', '".$_POST['password']."', '".$_POST['name1']."', '".$_POST['name2']."', '".$_POST['email']."', '".$_POST['website']."', 'images/avatar.jpg')")
or die(
"ERROR: MYSQL ".mysql_error());

// exito al registrarse
$mensaje "Se a registrado exitosamente ahora podra Iniciar Sesion";
echo 
"<script>";
echo 
"alert('$mensaje');";
echo 
"window.location = 'http://web.com';";
echo 
"</script>";

}

?>

Última edición por Most; 26/03/2010 a las 10:25