Hola, adjunto el código que indicas pues es más cómodo revisarlo pudiendo acceder a él directamente:
<?php
session_start(); ?>
<?php require_once('Connections/conexion_usuarios.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;
}
}
// *** Redirect if username exists
$MM_flag="MM_insert";
if (isset($_POST[$MM_flag])) {
$MM_dupKeyRedirect="ya_existe_registro.php";
$loginUsername = $_POST['email'];
$LoginRS__query = sprintf("SELECT email FROM usuarios WHERE email=%s", GetSQLValueString($loginUsername, "text"));
mysql_select_db($database_conexion_usuarios, $conexion_usuarios);
$LoginRS=mysql_query($LoginRS__query, $conexion_usuarios) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
//if there is a row in the database, the username was found - can not add the requested username
if($loginFoundUser){
$MM_qsChar = "?";
//check captcha
include_once 'http://localhost/sitio4/securimage/securimage.php';
$securimage = new Securimage();
// Verifify captcha
if ($secureimage->check($post['captcha_code']) == false){
echo "The security code entered was incorrect.<br />";
echo "<a href='javascript:history.go(-1)'>Try again</a>.";
exit;
}
//append the username to the redirect page
if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
$MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar ."requsername=".$loginUsername;
header ("Location: $MM_dupKeyRedirect");
exit;
}
}
$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 usuarios (nombre, apellido, email, clave, pais, ciudad) VALUES (%s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['nombre'], "text"),
GetSQLValueString($_POST['apellido'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['clave'], "text"),
GetSQLValueString($_POST['pais'], "text"),
GetSQLValueString($_POST['ciudad'], "text"));
mysql_select_db($database_conexion_usuarios, $conexion_usuarios);
$Result1 = mysql_query($insertSQL, $conexion_usuarios) 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));
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<meta content="es-pe" http-equiv="Content-Language" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="estilos.css">
<style type="text/css">
#apDiv1 {
position: absolute;
width: 630px;
height: 90px;
z-index: 1;
left: 620px;
top: 95px;
background-color: #FAFAFA;
text-align: center;
font-size: 36px;
}
#apDiv2 {
position: absolute;
width: 630px;
height: 385px;
z-index: 2;
left: 620px;
top: 184px;
background-color: #FAFAFA;
text-align: center;
color: #D56939;
}
#apDiv1 p {
font-size: 36px;
}
#apDiv2 #form1 table tr td {
font-size: 24px;
}
#apDiv3 {
position: absolute;
width: 303px;
height: 243px;
z-index: 3;
left: 90px;
top: 272px;
text-align: center;
}
#apDiv4 {
position: absolute;
width: 254px;
height: 249px;
z-index: 3;
left: 124px;
top: 85px;
text-align: center;
}
#apDiv5 {
position: absolute;
width: 200px;
height: 115px;
z-index: 3;
left: 98px;
top: 255px;
}
#apDiv6 {
position: absolute;
width: 200px;
height: 115px;
z-index: 3;
}
#apDiv7 {
position: absolute;
width: 292px;
height: 248px;
z-index: 3;
left: 90px;
top: 218px;
text-align: center;
}
#apDiv2 p a {
color: #D56939;
}
</style>
<script type="text/javascript">
function MM_validateForm() { //v4.0
if (document.getElementById){
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' Debe ingresar una dirección de correo electrónico.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' es requerido.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es requerido.\n'; }
} if (errors) alert('DATOS OBLIGATORIOS PARA PODER REGISTRARSE:\n'+errors);
document.MM_returnValue = (errors == '');
} }
</script>
</head>
<body background="images/fondoserv.jpg" onfocus="MM_validateForm('nombre','','R','apellido','','R','email','','RisEmail','clave','','R','pais','','R','ciudad','','R');return document.MM_returnValue">
<header class="header2">
<div class="wrapper">
</div>
<nav>
<a href="index.html" class="auto-style2">INICIO</a>
<a href="#" class="auto-style2">INFO</a>
<a href="#" class="auto-style2">SERVICIOS</a>
<a href="#" class="auto-style2">BLOG</a>
<a href="#" class="auto-style2">CONTACTO</a>
</nav>
</div>
</header>
<!--- Empieza contenido del texto---><!-- TemplateBeginEditable name="doctitle" -->
<title>Registro de usuarios</title>
<!-- TemplateEndEditable -->
<style type="text/css">
p.MsoNormal
{margin-top:0cm;
margin-right:0cm;
margin-bottom:8.0pt;
margin-left:0cm;
line-height:107%;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
}
.auto-style2 {
font-family: "Humanst521 BT";
}
p.Aurelio
{margin-bottom:.0001pt;
text-align:justify;
font-size:12.0pt;
font-family:"Times New Roman",serif;
margin-left: 0cm;
margin-right: 0cm;
margin-top: 0cm;
}
p.MsoListParagraph
{margin-top:0cm;
margin-right:0cm;
margin-bottom:8.0pt;
margin-left:36.0pt;
line-height:107%;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
}
</style>
<div id="apDiv7"><img src="images/rombo-id-web.png" width="405" height="320" /></div>
</head>
<body style="background-attachment: fixed; background-color: #FFFFFF; background-image: url('../Fotografías/Fondos%20Pantalla/fondo-tres.jpg'); background-repeat: no-repeat; background: url('images/fondoserv.jpg') no-repeat fixed center;">
<div id="apDiv1">
<p> </p>
<p>Registro de usuario</p>
</div>
<div id="apDiv2">
<p> </p>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center" class="wrapper">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Nombre:</td>
<td><input name="nombre" type="text" id="nombre" onfocus="MM_popupMsg('Debe ingresar la totalidad de los datos...')" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Apellido:</td>
<td><input name="apellido" type="text" id="apellido" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> Correo electrónico: </td>
<td><input name="email" type="text" id="email" onblur="MM_validateForm('nombre','','R','apellido','','R','email','','RisEmail','clave','','R','pais','','R','ciudad','','R','codpost','','R');return document.MM_returnValue" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Contraseña:</td>
<td><input name="clave" type="password" id="clave" onfocus="MM_validateForm('nombre','','R','apellido','','R','email','','RisEmail','clave','','R','pais','','R');return document.MM_returnValue" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">País:</td>
<td><input name="pais" type="text" id="pais" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Ciudad:</td>
<td><input name="ciudad" type="text" id="ciudad" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"><img id="captcha" src="http://localhost/sitio4/securimage/securimage_show.php" alt="CAPTCHA Image" /></td>
<td><p>
<input type="text" name="captcha_code" size="8" maxlength="6" />
<a href="#" onclick="document.getElementById('captcha').src = 'http.//localhost/sitio4/securimage/securimage_show.php?' + Math.random(); return false"> ¡Prueba con otra imagen</a><a href="#">!</a></p>
<p> </p></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" class="wrapper" value="Guarda tus datos" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p> </p>
<p> </p>
<p> </p>
</div>
</body>
</html>
Saludos