aqui te envio es formulario unico como lo tengo
normalmente
Código PHP:
Ver original<?php
@include("Includes/Configurar.php");
@include("Includes/Funciones.php");
@include("Includes/Conexion.php");
$msg = "";
if($_POST['agregar'])
{
if(!empty($_POST['Cuenta']) || !empty($_POST['Nombres']) || !empty($_POST['Apellidos']) || !empty($_POST['Email'])) {
$Cuenta = Seguridad($_POST["Cuenta"]);
$Nombre = Seguridad($_POST["Nombre"]);
$Apellidos = Seguridad($_POST["Apellidos"]);
$Email = Seguridad($_POST["Email"]);
$sql = "INSERT INTO usuarios (Cuenta,
Nombre,
Apellidos,
Email) VALUES ('".$Cuenta."',
'".$Nombre."',
'".$Apellidos."',
'".$Email."')";
$msg = "</td>
</tr>
</table>
<table class=\"cart_last_product std\">
<tr>
<th colspan=\"2\">Cuenta Registrada Correctamente.</th>
</tr>
</table>";
} else {
$msg = "</td>
</tr>
</table>
<table class=\"cart_last_product std\">
<tr>
<th colspan=\"2\">Aviso: Rellene todo el formulario.</th>
</tr>
</table>";
}
}
if($_SESSION['Acceso'])
{
$usuario = mysql_fetch_array(Query
("SELECT * FROM `usuarios` WHERE Email='".$_SESSION['Email']."'")); $privilegios = $usuario["privilegios"];
}else
{
}
if($privilegios == "admin"){
?>
<?=$msg;?>
<form name="rg" action="" method="post" enctype="multipart/form-data" class="std identity">
<fieldset>
<p class="required text">
<label for="firstcuenta">Direccion de Cuenta</label>
<input type="text" id="Cuenta" name="Cuenta" /> <sup>*</sup>
</p>
<p class="required text">
<label for="firstnombre">Nombres</label>
<input type="text" id="Nombre" name="Nombre" /> <sup>*</sup>
</p>
<p class="required text">
<label for="firstapellido">Apellidos</label>
<input type="text" id="Apellidos" name="Apellidos" /> <sup>*</sup>
</p>
<p class="required text">
<label for="firstemail">Correo Electronico</label>
<input type="text" id="Email" name="Email" /> <sup>*</sup>
</p>
<p class="required required_desc"><sup>*</sup>Todos los Campos son Obligatorios</p>
<p class="submit">
<input type="submit" class="button" name="agregar" value="Guardar" />
</p>
</fieldset>
</form>
<?php }else
{
}?>
y esta es la forma como me dices que lo realize:
Código PHP:
Ver original<?php
@include("Includes/Configurar.php");
@include("Includes/Funciones.php");
@include("Includes/Conexion.php");
$msg = "";
if($_POST['agregar'])
{
if(!empty($_POST['Cuenta']) || !empty($_POST['Nombres']) || !empty($_POST['Apellidos']) || !empty($_POST['Email'])) {
$busqueda= mysql_query("SELECT Email FROM usuarios WHERE Email='".$Email."'");
echo "email existe";
}
else {
$Cuenta = Seguridad($_POST["Cuenta"]);
$Nombre = Seguridad($_POST["Nombre"]);
$Apellidos = Seguridad($_POST["Apellidos"]);
$Email = Seguridad($_POST["Email"]);
$sql = "INSERT INTO usuarios (Cuenta,
Nombre,
Apellidos,
Email) VALUES ('".$Cuenta."',
'".$Nombre."',
'".$Apellidos."',
'".$Email."')";
$msg = "</td>
</tr>
</table>
<table class=\"cart_last_product std\">
<tr>
<th colspan=\"2\">Cuenta Registrada Correctamente.</th>
</tr>
</table>";
}
}
else {
$msg = "</td>
</tr>
</table>
<table class=\"cart_last_product std\">
<tr>
<th colspan=\"2\">Aviso: Rellene todo el formulario.</th>
</tr>
</table>";
}
}
if($_SESSION['Acceso'])
{
$usuario = mysql_fetch_array(Query
("SELECT * FROM `usuarios` WHERE Email='".$_SESSION['Email']."'")); $privilegios = $usuario["privilegios"];
}else
{
}
if($privilegios == "admin"){
?>
<?=$msg;?>
<form name="rg" action="" method="post" enctype="multipart/form-data" class="std identity">
<fieldset>
<p class="required text">
<label for="firstcuenta">Direccion de Cuenta</label>
<input type="text" id="Cuenta" name="Cuenta" /> <sup>*</sup>
</p>
<p class="required text">
<label for="firstnombre">Nombres</label>
<input type="text" id="Nombre" name="Nombre" /> <sup>*</sup>
</p>
<p class="required text">
<label for="firstapellido">Apellidos</label>
<input type="text" id="Apellidos" name="Apellidos" /> <sup>*</sup>
</p>
<p class="required text">
<label for="firstemail">Correo Electronico</label>
<input type="text" id="Email" name="Email" /> <sup>*</sup>
</p>
<p class="required required_desc"><sup>*</sup>Todos los Campos son Obligatorios</p>
<p class="submit">
<input type="submit" class="button" name="agregar" value="Guardar" />
</p>
</fieldset>
</form>
<?php }else
{
}?>
pero pareciera que no hace nada.. y registra siempre todo igual