primero uffff cuanto amor
segundo aqui te envio un codigo, tendras que modificarlo a tu gusto
primera parte
registring.php
Código PHP:
<html>
<head>
<title>Register Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="estilo.css" rel="stylesheet" type="text/css">
<script>
function check_form()
{
if (document.form.nick.value == "")
{
alert("Please insert a User Name");
document.form.nick.focus();
return;
}
if (document.form.e_mail.value == "")
{
alert("Insert Your E-Mail");
document.form.e_mail.focus();
return false;
}
if (document.form.e_mail.value.indexOf('@', 0) == -1 ||
document.form.e_mail.value.indexOf('.', 0) == -1) {
alert("invalid E-Mail");
document.form.e_mail.focus();
return (false);
}
if (document.form.password.value == "")
{
alert("Please insert Your password");
document.form.password.focus();
return;
}
if (document.form.cpassword.value == "")
{
alert("Please insert Your password again");
document.form.cpassword.focus();
return;
}
if (document.form.first_name.value == "")
{
alert("Please insert Your First Name");
document.form.first_name.focus();
return;
}
if (document.form.last_name.value == "")
{
alert("Please insert Your Last Name");
document.form.last_name.focus();
return;
}
if (document.form.phone.value == "")
{
alert("Please insert Your Phone Number");
document.form.phone.focus();
return;
}
if (isNaN(document.form.phone.value))
{
alert ("Insert a valid Phone Number");
document.form.phone.focus();
return (false);
}
caracteres=document.form.phone.value.length;
if(caracteres<7)
{
alert("Insert a valid Phone Number");
document.form.phone.focus();
return (false);
}
if (document.form.code.value == "")
{
alert("Insert a Code Number");
document.form.code.focus();
return;
}
if (isNaN(document.form.code.value))
{
alert ("Insert a valid Code Number");
document.form.code.focus();
return (false);
}
caracteres=document.form.code.value.length;
if(caracteres<3)
{
alert("Insert a valid Code Number");
document.form.code.focus();
return (false);
}
document.form.submit();
}
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center"><img src="imagenes/tiulo(1).gif"> </div>
<form action="register_send.php" method="post" enctype="multipart/form-data" name="form">
<table width="327" height="280" border="0" align="center" background="imagenes/fondo_reg.gif">
<tr>
<td width="144"> <b>*User Name:</b> </td>
<td colspan="2"> <input type="text" name="nick" value="" class="t_n" size="17" maxlength="17">
</td>
</tr>
<tr>
<td> <b>*E-mail address:</b> </td>
<td colspan="2"> <input type="text" name="e_mail" value="" class="t_n" size="17">
</td>
</tr>
<tr>
<td> <b>*Password</b> </td>
<td colspan="2"> <input type="password" name="password" value="" class="t_n" size="17">
</td>
</tr>
<tr>
<td> <b>*Confirm Password</b></td>
<td colspan="2"> <input type="password" name="cpassword" value="" class="t_n" size="17">
</td>
</tr>
<tr>
<td> <b>*First Name:</b> </td>
<td colspan="2"> <input type="text" name="first_name" class="t_n" value="" size="17">
</td>
</tr>
<tr>
<td> <b>*Last Name:</b> </td>
<td colspan="2"> <input type="text" name="last_name" class="t_n" value="" size="17">
</td>
</tr>
<tr>
<td><b>*Phone Number:</b> </td>
<td width="20"><input type="text" maxlength="4" class="t_n" size="4" name="code"></td>
<td width="149"><input type="text" name="phone" class="t_n" size="17" maxlength="7"></td>
</tr>
<tr>
<td> <b>Address:</b></td>
<td colspan="2"> <input type="text" name="address" class="t_n" value="" size="17">
</td>
</tr>
<tr>
<td> <b>Country:</b></td>
<td colspan="2"> <select class="t_n" name="country">
<option selected>Select Your Country</option>
<?php
$hostname = "localhost";
$database = "tudatabase";
$username = "root";
$password = "";
$coneccion = mysql_pconnect($hostname, $username, $password) or die(mysql_error());
mysql_select_db($database, $coneccion);
$query = "SELECT * FROM paises ORDER BY id_pais";
$estados = mysql_query($query, $coneccion) or die(mysql_error());
$row_estados = mysql_fetch_assoc($estados);
do {
$nombre = $row_estados['nombre_pais'];
print "
<option>" . $nombre . "</option>
";
} while ($row_estados = mysql_fetch_assoc($estados));
?>
</select></td>
</tr>
<tr>
<td> <b>State:</b> </td>
<td colspan="2"> <select name="state" class="t_n">
<option Selected>Select Your State</option>
<?php
$hostname = "localhost";
$database = "tudatabase";
$username = "root";
$password = "";
$coneccion = mysql_pconnect($hostname, $username, $password) or die(mysql_error());
mysql_select_db($database, $coneccion);
$query = "SELECT * FROM estados_usa ORDER BY id_est";
$estados = mysql_query($query, $coneccion) or die(mysql_error());
$row_estados = mysql_fetch_assoc($estados);
do {
$nombre = $row_estados['nombre_est'];
print "
<option>" . $nombre . "</option>
";
} while ($row_estados = mysql_fetch_assoc($estados));
?>
</select></td>
</tr>
<tr>
<td> <b>City:</b> </td>
<td colspan="2"> <input type="text" name="city" class="t_n" value="" size="17">
</td>
</tr>
<tr>
<td> <b>Zip Code:</b> </td>
<td colspan="2"> <input type="text" name="zip_code" class="t_n" value="" size="17">
</td>
</tr>
<tr>
<td> <b>Fax Number:</b> </td>
<td colspan="2"><input type="text" name="fax" class="t_n" value="" size="17"></td>
</tr>
<tr>
<td><img src="imagenes/spacer.gif" width="1" height="5"></td>
</tr>
<tr>
<td colspan="3" align="right"> <div align="center">
<input type="hidden" name="MM_insert" value="form">
<input type="button" name="Submit" class="t_n" value="Send" onClick="check_form()">
<input type="reset" name="Reset" class="t_n" value="Reset">
<input type="button" name="Button" value="Close" class="t_n" onClick="self.close();return false">
</div></td>
</tr>
<tr>
<td colspan="3">The Fields with ( * ) are required.</td>
</tr>
</table>
<div align="center"></div>
</form>
</body>
</html>
saludos