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> </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> </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> </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> </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> </p></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </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> </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