CODIGO:
<%--
Document : pag
Created on : 24/10/2013, 10:22:40 PM
Author : yusesito
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Curp</title>
</head>
<body bgcolor="blue" text="white">
<%! String nom,paterno,materno,ano,mes,dia,sexo,nace,m2,n2; %>
<%
nom=request.getParameter("Nombre");
paterno=request.getParameter("Paterno");
materno=request.getParameter("Materno");
ano=request.getParameter("Ano");
mes=request.getParameter("Mes");
dia=request.getParameter("Dia");
sexo=request.getParameter("Sexo");
nace=request.getParameter("Nace");
m2=request.getParameter("Materno2");
n2=request.getParameter("Nombre2");
%>
<!--Imprimir -->
<center>
<h1><b>Tu CURP es:</b></h1><br><br>
<%
out.println(request.getParameter("Paterno").substring(0,2).toUpperCase());
out.println(request.getParameter("Materno").substring(0,1).toUpperCase());
out.println(request.getParameter("Nombre").substring(0,1).toUpperCase());
out.println(request.getParameter("Ano").substring(2,4));
if(request.getParameter("Mes").equals("enero"))
{
mes=request.getParameter("Mes");
out.println("01");
}
if(request.getParameter("Mes").equals("febrero"))
{
mes=request.getParameter("Mes");
out.println("02");
}
if(request.getParameter("Mes").equals("marzo"))
{
mes=request.getParameter("Mes");
out.println("03");
}
if(request.getParameter("Mes").equals("abril"))
{
mes=request.getParameter("Mes");
out.println("04");
}
if(request.getParameter("Mes").equals("mayo"))
{
mes=request.getParameter("Mes");
out.println("05");
}
if(request.getParameter("Mes").equals("junio"))
{
mes=request.getParameter("Mes");
out.println("06");
}
if(request.getParameter("Mes").equals("julio"))
{
mes=request.getParameter("Mes");
out.println("07");
}
if(request.getParameter("Mes").equals("agosto"))
{
mes=request.getParameter("Mes");
out.println("08");
}
if(request.getParameter("Mes").equals("septiembre"))
{
mes=request.getParameter("Mes");
out.println("09");
}
if(request.getParameter("Mes").equals("octubre"))
{
mes=request.getParameter("Mes");
out.println("10");
}
if(request.getParameter("Mes").equals("noviembre"))
{
mes=request.getParameter("Mes");
out.println("11");
}
if(request.getParameter("Mes").equals("diciembre"))
{
mes=request.getParameter("Mes");
out.println("12");
}
out.println(request.getParameter("Dia"));
out.println(request.getParameter("Sexo").substring(0,1).toUpperCase());
out.println(request.getParameter("Nace").substring(0,1).toUpperCase());
out.println(request.getParameter("Nace").substring(9,10).toUpperCase());
out.println(request.getParameter("Nace").substring(15,16).toUpperCase());
out.println(request.getParameter("Materno2").substring(2,3).toUpperCase());
out.println(request.getParameter("Nombre2").substring(1,2).toUpperCase());
%>
</body>
</html>
IMAGEN
No hay comentarios:
Publicar un comentario