Buenas tardes disculpen la molestia he estado buscando mucho en la red de como repetir la contraseña en un formulario, encontre un tema aqui y todo pero al darle enviar no sucede nada el tema es este.
http://www.phperos.net/foro/index.php?topic=1113.0cambie el valor de submit a button y no envia ni nada , pero al dejarlo el submit si envia mas no hace la funcion de verificar la contraseña , quien me podria ayudar de verdad le agradeceria mucho .
mi codigo
<?php require_once('../Connections/local.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 representantes (Nombre, Apellido, Edad, Sexo, Cedula, Telefono, Nacionalidad, Direccion, Correo, Contrasena, `Repetir Contraseña`, Usuario) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['Nombre'], "text"),
GetSQLValueString($_POST['Apellido'], "text"),
GetSQLValueString($_POST['Edad'], "int"),
GetSQLValueString($_POST['Sexo'], "text"),
GetSQLValueString($_POST['Cedula'], "text"),
GetSQLValueString($_POST['Telefono'], "int"),
GetSQLValueString($_POST['Nacionalidad'], "text"),
GetSQLValueString($_POST['Direccion'], "text"),
GetSQLValueString($_POST['Correo'], "text"),
GetSQLValueString($_POST['clave1'], "text"),
GetSQLValueString($_POST['clave2'], "text"),
GetSQLValueString($_POST['Usuario'], "text"));
mysql_select_db($database_local, $local);
$Result1 = mysql_query($insertSQL, $local) or die(mysql_error());
$insertGoTo = "../registrado.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO representantes (Nombre, Apellido, Edad, Sexo, Cedula, Telefono, Nacionalidad, Direccion, Correo, Contrasena, `Repetir Contraseña`, Usuario) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['Nombre'], "text"),
GetSQLValueString($_POST['Apellido'], "text"),
GetSQLValueString($_POST['Edad'], "int"),
GetSQLValueString($_POST['Sexo'], "text"),
GetSQLValueString($_POST['Cedula'], "text"),
GetSQLValueString($_POST['Telefono'], "int"),
GetSQLValueString($_POST['Nacionalidad'], "text"),
GetSQLValueString($_POST['Direccion'], "text"),
GetSQLValueString($_POST['Correo'], "text"),
GetSQLValueString($_POST['clave1'], "text"),
GetSQLValueString($_POST['clave2'], "text"),
GetSQLValueString($_POST['Usuario'], "text"));
mysql_select_db($database_local, $local);
$Result1 = mysql_query($insertSQL, $local) or die(mysql_error());
$insertGoTo = "../registrado.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<meta charset="utf-8">
<meta name="description" content="Custom Login Form Styling with CSS3" />
<meta name="keywords" content="css3, login, form, custom, input, submit, button, html5, placeholder" />
<meta name="author" content="Codrops" />
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="js/modernizr.custom.63321.js"></script>
<script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script><!--[if lte IE 7]><style>.main{display:none;} .support-note .note-ie{display:block;}</style><![endif]-->
<style>
body {
background: #e1c192 url(images/wood_pattern.jpg);
background-image: url(images/formato.jpg);
}
.NEGRO {
color: #000;
}
.NEGRO center a h3 {
color: #000;
}
.centro {
text-align: center;
}
</style>
<link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
<style type="text/css">
body,td,th {
font-family: Lato, Calibri, Arial, sans-serif;
}
a:visited {
color: #F00;
}
a:link {
color: #F00;
}
</style>
<center>
<h1> </h1>
<h1>Registro de Representantes</h1>
<p> </p>
<p> </p>
//AQUI ESTA EL CODIGO QUE AGREGE
<script type="text/javascript">
function checkval() {
if (document.getElementById("clave1").value != document.getElementById("clave2").value) {
alert("Las contraseñas que has introducido no son iguales");
return false;
} else {
document.form2.submit();
}
}
</script>
<form action="<?php echo $editFormAction; ?>" method="POST" name="form1" id="form1">
<p> </p>
<table align="center">
<tr valign="baseline">
<td width="100" align="left" nowrap="nowrap"><h1><strong>Nombre :*</strong></h1></td>
<td width="144"><span id="sprytextfield1">
<input type="text" name="Nombre" value="" size="25" />
<span class="textfieldRequiredMsg">Nombre?</span></span></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left"><h1><strong>Apellido :*</strong></h1></td>
<td><span id="sprytextfield2">
<input type="text" name="Apellido" value="" size="25" />
<span class="textfieldRequiredMsg">Apellido?</span></span></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left"><h1><strong>Edad :*</strong></h1></td>
<td><span id="sprytextfield6">
<input type="text" name="Edad" value="" size="3" />
<span class="textfieldRequiredMsg">Edad?</span></span></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left"><h1><strong>Sexo:</strong></h1></td>
<td><input type="text" name="Sexo" value="" size="25" placeholder="Masculino/Femenino"/></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left"><h1><strong>Cedula :*</strong></h1></td>
<td><span id="sprytextfield7">
<input type="text" name="Cedula" value="" size="7" />
<span class="textfieldRequiredMsg">Complete</span></span></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left"><h1><strong>Telefono:</strong></h1></td>
<td><input type="text" name="Telefono" value="" size="10" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left"><h1><strong>Nacionalidad:</strong></h1></td>
<td><input type="text" name="Nacionalidad" value="" size="25" placeholder="Venezolano / Extranjero"/></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left"><h1><strong>Direccion :*</strong></h1></td>
<td><span id="sprytextfield3">
<input type="text" name="Direccion" value="" size="25" />
<span class="textfieldRequiredMsg">Direccion?</span></span></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left"><h1><strong>Correo:</strong></h1></td>
<td><input type="text" name="Correo" value="@" size="25" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left"><h1><strong>Usuario :*</strong></h1></td>
<td><span id="sprytextfield4">
<input type="text" name="Usuario" value="" size="25" />
<span class="textfieldRequiredMsg">Usuario?</span></span></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left"><h1><strong>Contraseña :*</strong></h1></td>
<td><span id="sprytextfield5">
<input type="password" name="clave1" value="" size="25" />
<span class="textfieldRequiredMsg">Contraseña?</span></span></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left"><h1>Repetir:*</h1></td>
<td><span id="sprytextfield8"><span id="sprytextfield9">
<input type="password" name="clave2" value="" size="25" />
<span class="textfieldRequiredMsg">Verificar!!</span></span><span class="textfieldRequiredMsg">Contraseña?</span></span></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left"><h1> </h1></td>
<td><p> </p>
<p>
<input type="button" name="button" id="send" value="Enviar" onClick="checkval();"/>
</p></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p> </p>
</center>
<p class="mid"> </p>
<center>
<h2 class="NEGRO"><strong>Regresar a la pagina principal </strong></h2>
<h2><strong><a href="../indexvisitante.php">AQUI</a></strong><a href="../indexvisitante.php"></a></h2>
<h2> </h2></center>
<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");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5");
var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6");
var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7");
var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9");
</script>
<script>