Ver Mensaje Individual
  #4 (permalink)  
Antiguo 05/01/2009, 22:58
loschapines
 
Fecha de Ingreso: enero-2009
Mensajes: 12
Antigüedad: 15 años, 3 meses
Puntos: 0
Respuesta: Mi base de datos no guarda informacion

muchisimas gracias por tu respuesta, realize los cambios que me sugeriste pero aún no consigo obtener los datos de (full_name y user_name), aca esta el código con los cambios


<?php
session_start();


include ('dbc.php');


if ($_POST['Submit'] == 'Register')
{
if (strlen($_POST['email']) < 5)
{
die ("Incorrect email. Please enter valid email address..");
}
if (strcmp($_POST['pass1'],$_POST['pass2']) || empty($_POST['pass1']) )
{
//die ("Password does not match");
die("ERROR: Password does not match or empty..");

}
if (strcmp(md5($_POST['user_code']),$_SESSION['ckey']))
{
die("Invalid code entered. Please enter the correct code as shown in the Image");
}
$rs_duplicates = mysql_query("select id from users where user_email='$_POST[email]'");
$duplicates = mysql_num_rows($rs_duplicates);

if ($duplicates > 0)
{
//die ("ERROR: User account already exists.");
header("Location: register.php?msg=ERROR: User account already exists..");
exit();
}




$md5pass = md5($_POST['pass2']);
$activ_code = rand(1000,9999);
$server = $_SERVER['HTTP_HOST'];
$host = ereg_replace('www.','',$server);
mysql_query("INSERT INTO users
(`user_email`,`user_name`,`user_pwd`,`country`,`jo ined`,`activation_code`,`full_name`)
VALUES
('{$_POST[email]}','{$_POST[user_name]}','$md5pass','{$_POST[country]}',now(),'$activ_code','{$_POST[full_name]}')") or die(mysql_error());

$message =
"Thank you for registering an account with $server. Here are the login details...\n\n
User Email: $_POST[email] \n
Password: $_POST[pass2] \n
Activation Code: $activ_code \n
____________________________________________
*** ACTIVATION LINK ***** \n
Activation Link: http://$server/activate.php?usr=$_POST[email]&code=$activ_code \n\n
_____________________________________________
Thank you. This is an automated response. PLEASE DO NOT REPLY.
";

mail($_POST['email'] , "Login Activation", $message,
"From: \"Auto-Response\" <notifications@$host>\r\n" .
"X-Mailer: PHP/" . phpversion());
unset($_SESSION['ckey']);
echo("Registration Successful! An activation code has been sent to your email address with an activation link...");

exit;
}

?>
<link href="styles.css" rel="stylesheet" type="text/css">
<?php if (isset($_GET['msg'])) { echo "<div class=\"msg\"> $_GET[msg] </div>"; } ?>