Foros del Web » Programando para Internet » PHP »

[SOLUCIONADO] Como confirmar contraseñas en Dreamweaver

Estas en el tema de Como confirmar contraseñas en Dreamweaver en el foro de PHP en Foros del Web. Hola a todos. Tengo el siguiente codigo: <?php require_once('Connections/conexion1.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if ...
  #1 (permalink)  
Antiguo 26/04/2013, 17:55
 
Fecha de Ingreso: abril-2013
Mensajes: 2
Antigüedad: 11 años
Puntos: 0
Busqueda Como confirmar contraseñas en Dreamweaver

Hola a todos.

Tengo el siguiente codigo:

<?php require_once('Connections/conexion1.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO registro (nombrereal, nick, email, pass) VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['nombrereal'], "text"),
GetSQLValueString($_POST['nick'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['pass'], "text"));

mysql_select_db($database_conexion1, $conexion1);
$Result1 = mysql_query($insertSQL, $conexion1) or die(mysql_error());

$insertGoTo = "registro-ok.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
<style type="text/css">
.l {
color: #F60;
}
</style>
<h1 class="l">Registro</h1>
<hr>

<form method="post" name="form1" action="<?php echo $editFormAction; ?>" target="confirma" onSubmit="confirma = window.open('','confirma', 'width=300 height=200, status=no scrollbars=no, location=no, resizable=no, manu=no');">
<table width="473" align="center">
<tr valign="baseline">
<td width="63" align="right" nowrap>Nombre:</td>
<td width="398"><p><span id="sprytextfield1">
<input type="text" name="nombrereal" value="" size="32">
<span class="textfieldRequiredMsg">Se necesita un valor.</span></span></p>
<p>&nbsp; </p></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Nick:</td>
<td><p><span id="sprytextfield2">
<input type="text" name="nick" value="" size="32">
<span class="textfieldRequiredMsg">Se necesita un valor.</span></span></p>
<p>&nbsp; </p></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Email:</td>
<td><p><span id="sprytextfield3">
<input name="email" type="text" value="@" size="32">
<span class="textfieldRequiredMsg">Se necesita un valor.</span><span class="textfieldInvalidFormatMsg">Formato no válido.</span></span></p>
<p>&nbsp; </p></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Pass:</td>
<td><p><span id="sprytextfield4">
<input type="password" name="pass" value="" size="32">
<span class="textfieldRequiredMsg">Se necesita un valor.</span></span></p>
<p>&nbsp; </p></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Repass:</td>
<td><p><span id="sprytextfield4"><span id="sprytextfield5">
<input type="password" name="repass" value="" size="32">
<span class="textfieldRequiredMsg">Se necesita un valor.</span></span><span class="textfieldRequiredMsg">Se necesita un valor.</span></span></p>
<p>&nbsp; </p></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">&nbsp;</td>
<td><input type="submit" value="Registrarse">
<input type="reset" name="Reset" value="Restablecer" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p>&nbsp;</p>
<script type="text/javascript">
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "email");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5");
</script>





Soy nuevo en esto, lo que quiero es que se pueda confirmar la contraseña, que si no son iguales me saque un mensaje, la pagina esta en PHP.

Y otra opcion de confirmación que en email me pida en si un email, no otra cosa.

Muchas Gracias

Espero me puedan ayudar
  #2 (permalink)  
Antiguo 27/04/2013, 01:51
Avatar de jrclurita  
Fecha de Ingreso: febrero-2012
Ubicación: Lima
Mensajes: 33
Antigüedad: 12 años, 2 meses
Puntos: 0
Respuesta: Como confirmar contraseñas en Dreamweaver

Cita:
Iniciado por javierur10 Ver Mensaje
Hola a todos.

Tengo el siguiente codigo:

<?php require_once('Connections/conexion1.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO registro (nombrereal, nick, email, pass) VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['nombrereal'], "text"),
GetSQLValueString($_POST['nick'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['pass'], "text"));

mysql_select_db($database_conexion1, $conexion1);
$Result1 = mysql_query($insertSQL, $conexion1) or die(mysql_error());

$insertGoTo = "registro-ok.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
<style type="text/css">
.l {
color: #F60;
}
</style>
<h1 class="l">Registro</h1>
<hr>

<form method="post" name="form1" action="<?php echo $editFormAction; ?>" target="confirma" onSubmit="confirma = window.open('','confirma', 'width=300 height=200, status=no scrollbars=no, location=no, resizable=no, manu=no');">
<table width="473" align="center">
<tr valign="baseline">
<td width="63" align="right" nowrap>Nombre:</td>
<td width="398"><p><span id="sprytextfield1">
<input type="text" name="nombrereal" value="" size="32">
<span class="textfieldRequiredMsg">Se necesita un valor.</span></span></p>
<p>&nbsp; </p></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Nick:</td>
<td><p><span id="sprytextfield2">
<input type="text" name="nick" value="" size="32">
<span class="textfieldRequiredMsg">Se necesita un valor.</span></span></p>
<p>&nbsp; </p></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Email:</td>
<td><p><span id="sprytextfield3">
<input name="email" type="text" value="@" size="32">
<span class="textfieldRequiredMsg">Se necesita un valor.</span><span class="textfieldInvalidFormatMsg">Formato no válido.</span></span></p>
<p>&nbsp; </p></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Pass:</td>
<td><p><span id="sprytextfield4">
<input type="password" name="pass" value="" size="32">
<span class="textfieldRequiredMsg">Se necesita un valor.</span></span></p>
<p>&nbsp; </p></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Repass:</td>
<td><p><span id="sprytextfield4"><span id="sprytextfield5">
<input type="password" name="repass" value="" size="32">
<span class="textfieldRequiredMsg">Se necesita un valor.</span></span><span class="textfieldRequiredMsg">Se necesita un valor.</span></span></p>
<p>&nbsp; </p></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">&nbsp;</td>
<td><input type="submit" value="Registrarse">
<input type="reset" name="Reset" value="Restablecer" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p>&nbsp;</p>
<script type="text/javascript">
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "email");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5");
</script>





Soy nuevo en esto, lo que quiero es que se pueda confirmar la contraseña, que si no son iguales me saque un mensaje, la pagina esta en PHP.

Y otra opcion de confirmación que en email me pida en si un email, no otra cosa.

Muchas Gracias

Espero me puedan ayudar
Estas en el foro de PHP nativo, el foro para Dreamweaver esta aquí:

http://www.forosdelweb.com/tags/dreamweaver.html?f=17

saludos
__________________
Cuantas cosas por ver y no hay tiempo: "El defecto de las redes sociales es que nunca podemos ver todos los contenidos"

Etiquetas: confirmacion, contraseña
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 13:59.