Foros del Web » Programando para Internet » PHP »

Problema con el registro de usuario

Estas en el tema de Problema con el registro de usuario en el foro de PHP en Foros del Web. Bueno pues resulta que del tema pasado como pude resolvi el problema a ahora en la pagina login1 tengo la forma de login registro y ...
  #1 (permalink)  
Antiguo 06/05/2008, 09:36
 
Fecha de Ingreso: abril-2008
Mensajes: 9
Antigüedad: 16 años
Puntos: 0
Problema con el registro de usuario

Bueno pues resulta que del tema pasado como pude resolvi el problema a ahora en la pagina login1 tengo la forma de login registro y recordar, tengo una php donde alojo los valores que regoge la forma pero resulta que no recoge nada y ni guarda nada en base de datos

Ayuda super urgente
register

<?php
session_start();
require_once('Connections/mgold.php');

$midioma_objetos = "0";
if (isset($_GET['idioma'])) {
$midioma_objetos = (get_magic_quotes_gpc()) ? $_GET['idioma'] : addslashes($_GET['idioma']);
}
mysql_select_db($database_mgold, $mgold);
$query_objetos = sprintf("SELECT * FROM objetos_login WHERE objetos_login.idioma='%s'", $midioma_objetos);
$objetos = mysql_query($query_objetos, $mgold) or die(mysql_error());
$row_objetos = mysql_fetch_assoc($objetos);
$totalRows_objetos = mysql_num_rows($objetos);


$mgold = mysql_connect($hostname_mgold, $username_mgold, $password_mgold) or trigger_error(mysql_error(),E_USER_ERROR);

function formRegistro(){

// Preguntaremos si se han enviado ya las variables necesarias
if (isset($_POST["username"])) {
$username = $_POST["username"];
$password = $_POST["password"];
$cpassword = $_POST["cpassword"];
$name = $_POST["name"];
$zipcode = $_POST["zipcode"];
$number = $_POST["number"];
$email = $_POST["email"];
// Hay campos en blanco
if($username==NULL|$password==NULL|$number==NULL|$ cpassword==NULL|$email==NULL|$number==NULL) {
Header("Location: login1.php");
}else{
// ¿Coinciden las contraseñas?
if($password!=$cpassword) {
echo $row_objetos1['c_pass'];
formRegistro();
}else{
// Comprobamos si el nombre de usuario o la cuenta de correo ya existían
$checkuser = mysql_query("SELECT username FROM uuarios WHERE username='$username'");
$username_exist = mysql_num_rows($checkuser);

$checkemail = mysql_query("SELECT email FROM uuarios WHERE email='$email'");
$email_exist = mysql_num_rows($checkemail);

$checkemail = mysql_query("SELECT number FROM uuarios WHERE number='$number'");
$email_exist = mysql_num_rows($checknumber);

if ($email_exist>0|$username_exist>0) {
echo $row_objetos1['en_uso'];
formRegistro();

}else{
//Todo parece correcto procedemos con la inserccion
$query = "INSERT INTO uuarios (username, password, name, zipcode, number, email) VALUES('$username','$password','$name''$zipcode''$ number''$email')";
mysql_query($query) or die(mysql_error());
echo $row_objetos1['r_exito'];
}
}
}
}
mysql_select_db($database_mgold, $mgold);
$query_objetos = sprintf("SELECT * FROM objetos_registro WHERE objetos_registro.idioma='%s'", $midioma_objetos);
$objetos1 = mysql_query($query_objetos, $mgold) or die(mysql_error());
$row_objetos1 = mysql_fetch_assoc($objetos1);

mysql_select_db($database_mgold, $mgold);
$query_usuario = sprintf("SELECT * FROM uuarios WHERE uuarios.email='%s'", $mmail_usuario);
$usuario = mysql_query($query_usuario, $mgold) or die(mysql_error());
$row_usuario = mysql_fetch_assoc($usuario);
$totalRows_usuario = mysql_num_rows($usuario);


?>

Última edición por Scarlet_781; 06/05/2008 a las 09:46
  #2 (permalink)  
Antiguo 06/05/2008, 09:42
Avatar de Carlojas  
Fecha de Ingreso: junio-2007
Ubicación: Shikasta
Mensajes: 1.272
Antigüedad: 16 años, 10 meses
Puntos: 49
Re: Problema con el registro de usuario

Podrias publicar los códigos que estas utilizando para realizar el proceso? así será mas facil detectar el problema




Saludos.
  #3 (permalink)  
Antiguo 06/05/2008, 23:51
 
Fecha de Ingreso: abril-2008
Mensajes: 9
Antigüedad: 16 años
Puntos: 0
Exclamación Re: Problema con el registro de usuario

Hola
el login 1
<?php require_once('Connections/mgold.php');
$midioma_objetos = $_GET['idioma'];

// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}

$loginFormAction = $_SERVER['PHP_SELF']."?idioma=".$_GET['idioma']."&opcion=".$_GET['opcion']."";
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if ((isset($_POST["MM_login"])) && ($_POST["MM_login"] == "form1")) {
$loginUsername=$_POST['usuario'];
$password=$_POST['contrasena'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "home.php?idioma=" . $_GET['idioma'] . "&usuario=$loginUsername";
$MM_redirectLoginFailed = "login1.php?idioma=" . $_GET['idioma'] . "&opcion=" . $_GET['opcion'] ."";
$MM_redirecttoReferrer = false;
mysql_select_db($database_mgold, $mgold);

$LoginRS__query=sprintf("SELECT username, password FROM uuarios WHERE username='%s' AND password='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));

$LoginRS = mysql_query($LoginRS__query, $mgold) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";

//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;

if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}

mysql_select_db($database_mgold, $mgold);
$query_objetos = sprintf("SELECT * FROM objetos_login WHERE objetos_login.idioma='%s'", $midioma_objetos);
$objetos = mysql_query($query_objetos, $mgold) or die(mysql_error());
$row_objetos = mysql_fetch_assoc($objetos);
$totalRows_objetos = mysql_num_rows($objetos);

mysql_select_db($database_mgold, $mgold);
$query_princ = "SELECT * FROM objetos_princ where idioma='".$midioma_objetos."'";
$princ = mysql_query($query_princ, $mgold) or die(mysql_error());
$row_princ = mysql_fetch_assoc($princ);
?>

<html>
<head>
<title>Velas Club Members</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
background-color: #A9A381;
}
th {
color:#993300;
}
-->
</style>
<link href="estilos.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
color: #FFFFFF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FFFFFF;
}
a:hover {
text-decoration: underline;
color: #FFFFFF;
}
a:active {
text-decoration: none;
}
.Estilo1 {
color: #336633;
font-weight: bold;
font-style: italic;
font-family: 'Century Schoolbook';
font-size: 18px;
}
.Estilo3 {
font-size: 14px;
font-weight: bold;
font-style: italic;
}
.Estilo7 {font-size: 20px}
-->
</style><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body>
<table width="770" height="42" border="0" align="center">
<tr>
<th height="38" scope="col">
<table width="30%" border="0" align="right">
<tr>
<td width="29%" valign="bottom" ><span id="splogin" onMouseOver="splogin.style.cursor='pointer';splogi n.style.color='#0033FF'" onmouseout="splogin.style.color='#000000'" style="cursor:default" onClick="login.style.visibility='visible';forget.s tyle.visibility='hidden'"><font color="#993300" size="1" face="Geneva, Arial, Helvetica, sans-serif"><?php echo $row_princ['td_login']; ?></font></span></td>
<td width="30%" valign="bottom" ><span id="spremem" onMouseOver="spremem.style.cursor='pointer';spreme m.style.color='#0033FF'" onmouseout="spremem.style.color='#000000'" style="cursor:default" onClick="login.style.visibility='hidden';forget.st yle.visibility='visible'"><font color="#993300" size="1" face="Geneva, Arial, Helvetica, sans-serif"><?php echo $row_princ['td_remember']; ?></font></span></td>
<td width="30%" valign="bottom" ><span id="spregis" onMouseOver="spregis.style.cursor='pointer';spregi s.style.color='#0033FF'" onmouseout="spregis.style.color='#000000'" style="cursor:default" onClick="login.style.visibility='hidden';forget.st yle.visibility='visible'"><font color="#993300" size="1" face="Geneva, Arial, Helvetica, sans-serif"><?php echo $row_princ['td_register']; ?></font></span></td>
</tr>
</table></th>
</tr>
</table>
<table width="770" height="490" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<th height="490" align="center" valign="top" scope="col"><table width="100%" height="225" border="0" cellpadding="0" cellspacing="0">
<tr>
<th height="225" align="center" valign="top" scope="col">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="770" height="220" align="baseline">
<param name="movie" value="flash/intro.swf"/>
<param name="quality" value="high" /><param name="SCALE" value="exactfit">
<embed src="flash/intro.swf" width="770" height="220" align="baseline" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" scale="exactfit" ></embed>
</object> </th>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th height="280" align="center" valign="top" scope="col">
<table width="270" border="0" style="table-layout:fixed">
<tr>
<th width="900" height="50" class="Estilo1" scope="col"><div align="center" class="Estilo1 Estilo7"><?php echo $row_objetos['Bienvenido']; ?></div></th>
</tr>
</table>
<table style="table-layout:fixed" border="0" class="tit_login">
<tr>
<th width="495" valign="middle" style="font-Family:'Century Schoolbook';font-size:13px;" scope="col"><span class="Estilo3"><?php echo $row_objetos['tit_pag']; ?></span></th>
</tr>
</table>
<!--**************************** Div para el login -->
<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
<form ACTION="" method="POST" name="form1" id="form1">
<script>
var ancho=document.body.offsetWidth;
left = (ancho-350)/2;
document.write('<div id="login" style="position:absolute; width:300; top:350px; left:'+left+'px; visibility:hidden" align="center">');
</script>
<p>&nbsp;</p>
<table style="table-layout:fixed" border="0" class="txt_login" >
<tr>
<th align="right" valign="middle" ><?php echo $row_objetos['usuario']; ?></th>
<th align="left" valign="middle" ><input name="usuario" type="text" class="formulario" id="usuario" size="10" maxlength="10" /></th>
</tr>
</table>
<table style="table-layout:fixed" border="0" class="txt_login" >
<tr>
<th align="right" valign="middle" ><?php echo $row_objetos['contrasena']; ?></th>
<th align="left" valign="middle" ><input name="contrasena" type="password" class="formulario" id="contrasena" size="10" maxlength="10" /></th>
</tr>
</table>
<table style="table-layout:fixed" border="0" class="formulario">
<tr>
<th width="182" height="37" align="center" valign="bottom" scope="col"><input name="Submit" type="submit" class="formulario" value="<?php echo $row_objetos['boton']; ?>" />
<input name="idioma" type="hidden" id="idioma" value="<?php echo $_POST['idioma']; ?>" />
<input name="idioma" type="hidden" id="opcion" value="<?php echo $_POST['opcion']; ?>" />
<input name="MM_login" type="hidden" id="MM_login" value="form1" /> </th></tr>
</table>

</div>
</form>
  #4 (permalink)  
Antiguo 06/05/2008, 23:52
 
Fecha de Ingreso: abril-2008
Mensajes: 9
Antigüedad: 16 años
Puntos: 0
Re: Problema con el registro de usuario

<!--******************************* Div para el remember -->
<form action="envia_contrasena.php?idioma=<?php echo $_POST['idioma']; ?>" method="post" name="form2" target="_self" id="form2">
<script>
document.write('<div id="forget" style="position:absolute; width:300; top:350px; left:'+left+'px; visibility:hidden" align="center">');
</script>
<p>&nbsp;</p>
<table style="table-layout:fixed" border="0" class="txt_login">
<tr>
<table style="table-layout:fixed" border="0" class="txt_login">
<tr>
<th width="182" height="37" align="center" ><?php echo $row_objetos['olvidaste']; ?>&nbsp;
</th>

</tr>
</table>
<table style="table-layout:fixed" border="0" class="txt_login">
<tr>
<th align="left" scope="col"><?php echo $row_objetos['email']; ?><input name="email" type="text" class="formulario" id="email" size="27" maxlength="150" /></th>
</tr>
</table>
<table style="table-layout:fixed" border="0" class="txt_login">
<tr>&nbsp;
<th align="center" valign="middle" scope="col"><input name="Submit2" type="submit" class="formulario" value="<?php echo $row_objetos['enviar']; ?>" />
<input name="usuario" type="hidden" id="usuario" value="<?php echo $row_objetos['usuario']; ?>" />
<input name="contrasena" type="hidden" id="contrasena" value="<?php echo $row_objetos['contrasena']; ?>" /></th>
</tr>
</table>
<th width="20" align="left" valign="middle" scope="col">&nbsp;</th>
</tr>
</table>
</div>
</form>
<div align="center">

<form method="post" action="<? echo ($PHP_SELF); ?>">
<table width=277 height="176" border=0 cellpadding=0 cellspacing=0 cols=2>
<tr>
<td width=170 height="37"><strong>
Name:
</strong></td>
<td width=107>
<input type="text" name="uid" size="15">
</td>
</tr>
<tr>
<td width=170 height="41"><strong>
Code Zip:
</strong></td>
<td width=107>
<input type="text" name="pwd" SIZE="15">
</td>
</tr>
tr>
<td width=170 height="39"><strong>
Number of contract:
</strong></td>
<td width=107>
<input type="text" name="uid" size="15">
</td>
</tr>
tr>
<td width=170 height="39"><strong>
E- mail:
</strong></td>
<td width=107>
<input type="text" name="uid" size="15">
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input name="submitregister" type="submit" id="submitregister" value="Send Register">
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
<?php
switch ($_GET['opcion'])
{
case "1": echo '<script>login.style.visibility="visible";forget.s tyle.visibility="hidden"</script>';break;
case "2": echo '<script>login.style.visibility="hidden";forget.st yle.visibility="visible"</script>';break;
case "3": echo '<script>login.style.visibility="hidden";forget.st yle.visibility="visible"</script>';break;
}
mysql_free_result($objetos);
mysql_free_result($princ);
?>

El anterior es el register

De verdad espero me puedas ayudar

GRacias de ante mano
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:04.