Foros del Web » Programando para Internet » PHP »

[SOLUCIONADO] Error sistema de usuarios

Estas en el tema de Error sistema de usuarios en el foro de PHP en Foros del Web. Buenas a todos. He creado un sistema de usuarios con un formulario y cuando introdusco los datos de usuario me da este error Parse error: ...
  #1 (permalink)  
Antiguo 27/01/2014, 13:36
 
Fecha de Ingreso: enero-2014
Ubicación: Sevilla
Mensajes: 36
Antigüedad: 10 años, 3 meses
Puntos: 0
Error sistema de usuarios

Buenas a todos.
He creado un sistema de usuarios con un formulario y cuando introdusco los datos de usuario me da este error Parse error: syntax error, unexpected 'isset' (T_ISSET), expecting '(' in C:\wamp\www\sistema de usuarios\registrar_c.php on line 5
Aqui os dejo el codigo:

formulario:

<!doctype html>
<html lang="es">
<head>
<title>Formulario</title>
<meta charset="utf-8">
</head>
<body>
<form action="registrar_c.php"method="post">
<table widht="200" border="0">
<tr>
<td>NOMBRE:</td>
<td><input type="text" name="nombre"/></td>
</tr>
<tr>
<td>USUARIO:</td>
<td><input type="text" name="user"/></td>
</tr>
<tr>
<td>CONTRASEÑA</td>
<td><input type="text" name="pw"/></td>
</tr>
<tr>
<td>CONFIRMAR CONTRASEÑA</td>
<td><input type="text" name="pw2"/></td>
</tr>
<tr>
<td>E MAIL</td>
<td><input type="text" name="email"/></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Registrar" /></td>
</tr>
</table>
</body>
</html>

conexion:
<?php

$host = "localhost";
$user = "root";
$pw = "1234";
$db = "reg_users";

?>

registro:
<?php

include("conexion.php");

if isset($_POST['nombre'])) && !empty($_POST['nombre']) &&
isset($_POST['user'])) && !empty($_POST['user']) &&
isset($_POST['pw'])) && !empty($_POST['pw']) &&
isset($_POST['pw2'])) && !empty($_POST['pw2']) &&
isset($_POST['email'])) && !empty($_POST['email']) &&

$S_POST['pw'] == $S_POST['pw2'] )
{


$con = mysql_connect($host,$user,$pw)
or die("Problema al conectar el servidor");

mysql_select_db($db,$con)
or die("Problema al conectar db");

mysql_query("INSERT INTO registro (NOMBRE,USER,PW,EMAIL)
VALUES ('$_POST[nombre]' , '$_POST[user]' , '$_POST[pw]' , '$_POST[email]')",$con);
echo "Datos insertados<br>";
echo "NOMBRE: . '$_POST[nombre] '. <br>"
echo "USUARIO: . '$_POST[user]' '. <br>"
echo "CONTRASEÑA: .'$_POST[pw] '. <br>"
echo "E MAIL: . '$_POST[email] '. <br>"

}else{



echo "Verifica si tu contraseña coincide";
}

?>
Gracias.
  #2 (permalink)  
Antiguo 27/01/2014, 14:29
Avatar de rottenp4nx  
Fecha de Ingreso: octubre-2012
Ubicación: Santiago
Mensajes: 417
Antigüedad: 11 años, 6 meses
Puntos: 36
Respuesta: Error sistema de usuarios

Tienes que cerrar la condición if en parentesis

Saludos
  #3 (permalink)  
Antiguo 27/01/2014, 14:49
 
Fecha de Ingreso: enero-2014
Ubicación: Sevilla
Mensajes: 36
Antigüedad: 10 años, 3 meses
Puntos: 0
Respuesta: Error sistema de usuarios

De que manera?
if (isset)($_POST['nombre'])) && !empty($_POST['nombre']) &&
isset($_POST['user'])) && !empty($_POST['user']) &&
isset($_POST['pw'])) && !empty($_POST['pw']) &&
isset($_POST['pw2'])) && !empty($_POST['pw2']) &&
isset($_POST['email'])) && !empty($_POST['email']) &&
asi?
  #4 (permalink)  
Antiguo 27/01/2014, 15:09
 
Fecha de Ingreso: mayo-2009
Mensajes: 166
Antigüedad: 14 años, 11 meses
Puntos: 2
Respuesta: Error sistema de usuarios

if (isset($_POST['nombre']) && !empty($_POST['nombre']) &&
isset($_POST['user']) && !empty($_POST['user']) &&
isset($_POST['pw']) && !empty($_POST['pw']) &&
isset($_POST['pw2']) && !empty($_POST['pw2']) &&
isset($_POST['email']) && !empty($_POST['email']) && ($S_POST['pw'] == $S_POST['pw2'] )) {

fijate ese revisá los paréntesis

ahi fijate
  #5 (permalink)  
Antiguo 27/01/2014, 15:13
 
Fecha de Ingreso: enero-2014
Ubicación: Sevilla
Mensajes: 36
Antigüedad: 10 años, 3 meses
Puntos: 0
Respuesta: Error sistema de usuarios

ya lo vi.muchas gracias
  #6 (permalink)  
Antiguo 27/01/2014, 15:24
 
Fecha de Ingreso: mayo-2009
Mensajes: 166
Antigüedad: 14 años, 11 meses
Puntos: 2
Respuesta: Error sistema de usuarios

No hay de que!

Etiquetas: formulario, html, mysql, registro, select, sistema, usuarios
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 02:44.