Foros del Web » Creando para Internet » Herramientas y Software »

Como confirmar contraseñas en Dreamweaver

Estas en el tema de Como confirmar contraseñas en Dreamweaver en el foro de Herramientas y Software 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 27/04/2013, 07:34
 
Fecha de Ingreso: abril-2013
Mensajes: 2
Antigüedad: 11 años
Puntos: 0
Pregunta 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 17/05/2013, 22:00
Avatar de freddy31DA  
Fecha de Ingreso: junio-2012
Mensajes: 84
Antigüedad: 11 años, 10 meses
Puntos: 2
Respuesta: Como confirmar contraseñas en Dreamweaver

Con Javascript podemos hacer una comprobación -en el cliente- para ver si se ha introducido la misma clave en los dos campos y, si es así, mandar el formulario al servidor o hacer aquellas acciones necesarias para continuar con el registro de ese visitante. En caso de que las dos claves sean distintas se debería informar al usuario de la situación para que vuelva a introducir la clave deseada correctamente. => http://www.desarrolloweb.com/articulos/880.php
__________________
Creo en Internet.
Amén.

Etiquetas: contraseña, dreamweaver, editores-web
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 07:57.