DeNunCianDo

DeNunCianDo (https://www.denunciando.com/)
-   Programacion (https://www.denunciando.com/programacion-115/)
-   -   cambiar de jsp a php cmo se hace (https://www.denunciando.com/programacion-115/511837-cambiar-de-jsp-php-cmo-se-hace.html)

tolima0611 19-08-2011 22:52:32

cambiar de jsp a php cmo se hace
 
<!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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
background-image: url(fondo1.jpg);
}
.Estilo1 {color: #FFFFFF}
.Estilo3 {color: #FFFFFF; font-size: 24px; }
.Estilo5 {color: #FFFFFF; font-weight: bold; }
.Estilo6 {color: #FF0000}
-->
</style>
<SCRIPT>
function validarEntero(valor){
//intento convertir a entero. PARA VALIDAR Q SEAN NUMEROS ENTEROS, BUENO ACA SE HACE LA CONVERSION LUEGO SE ASIGNA A LA FUNCION DONDE TIENE QUE SER UN ENTERO
//si era un entero no le afecta, si no lo era lo intenta convertir
valor = parseInt(valor)
//Compruebo si es un valor numérico
if (isNaN(valor)) {
//entonces (no es numero) devuelvo el valor cadena vacia
return ""
}else{
//En caso contrario (Si era un número) devuelvo el valor
return valor
}
} //TERMINA LA CONVERSION

function valida_envi(){
//valido el nombre VALIDA QUE EL NOMBRE NO ESTE EN VACIO PERO NO VALUDA CARACTERES INVALIDOS O Q SEAN NUMERICOS DONDE TIENE QUE SER TEXTO

cc = document.uno.cc.value
cc = validarEntero(cc)
document.uno.cc.value=cc
if (cc==""){
alert("Debe de escribir un numero de cedula o tiene un Error.")
document.uno.cc.focus()
return 0;
}

if (document.uno.tipo.selectedIndex==0){
alert("Debe seleccionar un tipo.")
document.uno.tipo.focus()
return 0;
}

if (document.uno.nombres.value.length==0){
alert("Debe escribir los nombres del cliente.")
document.uno.nombres.focus()
return 0;
}

if (document.uno.apellidos.value.length==0){
alert("Debe escribir los apellidos del cliente.")
document.uno.apellidos.focus()
return 0;
}

if (document.uno.direccion.value.length==0){
alert("Debe escribir la direccion del cliente.")
document.uno.direccion.focus()
return 0;
}

salario = document.uno.salario.value
salario = validarEntero(salario)
document.uno.salario.value=salario
if (salario==""){
alert("Debe de escribir el salario del cliente.")
document.uno.salario.focus()
return 0;
}

if (document.uno.email.value.length==0){
alert("Debe de escribir un E-mail o dejarlo en NO")
document.uno.email.focus()
return 0;
}
telcelular = document.uno.telcelular.value
telcelular = validarEntero(telcelular)
document.uno.telcelular.value=telcelular
if (telcelular==""){
alert("Debe de escribir un telefono celular.")
document.uno.telcelular.focus()
return 0;
}


telfijo = document.uno.telfijo.value
telfijo = validarEntero(telfijo)
document.uno.telfijo.value=telfijo
if (telfijo==""){
alert("Debe de escribir un telefono fijo.")
document.uno.telfijo.focus()
return 0;
}



if (document.uno.empresa.value.length==0){
alert("Debe de escribir el nombre de la empresa.")
document.uno.empresa.focus()
return 0;
}

if (document.uno.direccione.value.length==0){
alert("Debe escribir la dirrecion de la empresa donde labora el cliente.")
document.uno.direccione.focus()
return 0;
}

telfijoe = document.uno.telfijoe.value
telfijoe = validarEntero(telfijoe)
document.uno.telfijoe.value=telfijoe
if (telfijoe==""){
alert("Debe de escribir el numero de telefono fijo de la empresa.")
document.uno.telfijoe.focus()
return 0;
}

if (document.uno.r1nombres.value.length==0){
alert("Debe de escribir los nombres de la 1ra referencia.")
document.uno.r1nombres.focus()
return 0;
}

if (document.uno.r1apellidos.value.length==0){
alert("Debe de escribir los apellidos de la 1ra referencia.")
document.uno.r1apellidos.focus()
return 0;
}

r1telfijo = document.uno.r1telfijo.value
r1telfijo = validarEntero(r1telfijo)
document.uno.r1telfijo.value=r1telfijo
if (r1telfijo==""){
alert("Debe de escribir el numero telefonico fijo de la 1ra referencia.")
document.uno.r1telfijo.focus()
return 0;
}

if (document.uno.r2nombres.value.length==0){
alert("Debe de escribir los nombres de la 2da referencia.")
document.uno.r2nombres.focus()
return 0;
}

if (document.uno.r2apellidos.value.length==0){
alert("Debe de escribir los apellidos de la 2da referencia.")
document.uno.r2apellidos.focus()
return 0;
}


r2telfijo = document.uno.r2telfijo.value
r2telfijo = validarEntero(r2telfijo)
document.uno.r2telfijo.value=r2telfijo
if (r2telfijo==""){
alert("Debe de escribir el numero telefonico fijo de la 2da referencia.")
document.uno.r2telfijo.focus()
return 0;
}

if (document.uno.r3nombres.value.length==0){
alert("Debe de escribir los nombres de la referencia familiar.")
document.uno.r3nombres.focus()
return 0;
}

if (document.uno.r3apellidos.value.length==0){
alert("Debe de escribir los apellidos de la referencia familiar.")
document.uno.r3apellidos.focus()
return 0;
}

r3telfijo = document.uno.r3telfijo.value
r3telfijo = validarEntero(r3telfijo)
document.uno.r3telfijo.value=r3telfijo
if (r3telfijo==""){
alert("Debe de escribir el numero telefonico fijo de la referencia familiar.")
document.uno.r3telfijo.focus()
return 0;
}

document.uno.submit();
}
</SCRIPT></head>
<body><center>
<table width="751" border="10" bgcolor="#66CCFF">
<tr>
<th width="769" scope="col"><div align="center"><span class="Estilo3">FORMULARIO PARA INGRESAR PERFIL DEL CLIENTE</span></div></th>
</tr>
</table>
<form name="uno" action="insertarcliente.jsp" method="post">
<table border="20" align=<"center" cellspacing="10" bgcolor="#66CCFF">
<tr><td colspan="2"><div align="center" class="Estilo1">DATOS PERSONALES </div></td>
<tr>
<td>Numero de Cedula</td>
<td><input type="text" name="cc" /></td></tr>
<tr><td colspan="2"><div align="center">Tipo Cedula</div></td></tr>
<td><div align="center"> <input type="radio" name="tipo" checked="checked" value="C.C." /> C.C. </div></td>
<td><div align="center"> <input type="radio" name="tipo" value="C.E." /> C.E.</div></td>
<tr><td>Nombres</td>
<td><input type="text" name="nombres" /></td></tr>
<tr><td>Apellidos</td>
<td><input type="text" name="apellidos" /></td></tr>
<tr>
<td>Direccion Residencia </td>
<td><input type="text" name="direccion" /></td></tr>
<tr><td>Salario</td>
<td><input type="text" name="salario" /></td></tr>

<tr><td>Correo Electronico</td>
<td><input type="text" name="email" value="No" /></td></tr>

<tr><td colspan="2"><div align="center">Telefonos</div></td>
</tr>
<tr><td><div align="center">Celular</div></td>
<td><div align="center">Fijo</div></td>
<tr><td><input type="text" name="telcelular" /></td>
<td><input type="text" name="telfijo" /></td></tr>
<tr><td colspan="2"><div align="center" class="Estilo1">DATOS LABORALES </div></td>
<tr><td>Empresa</td>
<td><input type="text" name="empresa" /></td></tr>
<tr><td>Direccion Empresa</td>
<td><input type="text" name="direccione" /></td></tr>
<tr><td>Telefono Fijo Empresa</td>
<td><input type="text" name="telfijoe" /></td></tr>
<tr><td colspan="2"><div align="center" class="Estilo1">REFERENCIAS </div></td>
<tr><td colspan="2"><div align="left" class="Estilo5">Primera Personal</div></td>
<tr><td>Nombres</td>
<td><input type="text" name="r1nombres" /></td></tr>
<tr><td>Apellidos</td>
<td><input type="text" name="r1apellidos" /></td></tr>
<tr><td>Telefono Fijo </td>
<td><input type="text" name="r1telfijo" /></td></tr>
<tr><td colspan="2"><div align="left" class="Estilo5">Segunda Personal
</div>
</div></td>

<tr><td>Nombres</td>
<td><input type="text" name="r2nombres" /></td></tr>
<tr><td>Apellidos</td>
<td><input type="text" name="r2apellidos" /></td></tr>
<tr><td>Telefono Fijo </td>
<td><input type="text" name="r2telfijo" /></td></tr>
<tr><td colspan="2"><div align="left" class="Estilo5">Referencia Familiar
</div>
</div></td>

<tr><td>Nombres</td>
<td><input type="text" name="r3nombres" /></td></tr>
<tr><td>Apellidos</td>
<td><input type="text" name="r3apellidos" /></td></tr>
<tr><td>Telefono Fijo </td>
<td><input type="text" name="r3telfijo" /></td></tr>

<tr><td colspan="2"><div align="center" class="Estilo1">PERFIL </div></td>
<tr><td colspan="2"><div align="center">Tipo Persona</div></td>
</tr>
<tr><td><div align="center"> <input type="radio" checked="checked" name="persona" value="natural" /> Natural </div></td>
<td><div align="center"> <input type="radio" name="persona" value="juridica" /> Juridica</div></td>
<tr><td colspan="2"><div align="center">Tipo Cliente</div></td>
</tr>
<tr><td><div align="center"> <input type="radio" checked="checked" name="cliente" value="deudor" /> Deudor </div></td>
<td><div align="center"> <input type="radio" name="cliente" value="codeudor" /> Codeudor</div></td>
</table><br>
<input type="button" onclick="valida_envi()" value="Guardar" />
<input type="reset" value="Limpiar" />
</form>

</center>
</body>
</html>

ARICARRARO 01-09-2011 20:29:28

Respuesta: cambiar de jsp a php cmo se hace
 
Ejemplo.

Código PHP

<?php

//declarar variables;
$numero=99;
$cadena="Soy de Europa";
$real=9.6;

//imprimir mensaje
echo "Un simple mensaje";

//crear función

function Sumar($x1,$x2){
return $x1+$x2;
}

$misuma=Sumar(3,4);
//
echo "La suma de 3 + 4 es: $misuma";



?>

Código JSP
<%
//declarar variables
String cadena="Soy de México";
int numero=9;
double real=5.3;

out.println("Hola desde México");

public void mensaje(){
out.println("Este es un mensaje simple");
}

mensaje();



%>

Necesitas leer un tutorial sobre JSP.

MAU5 07-09-2011 17:13:19

Respuesta: cambiar de jsp a php cmo se hace
 
gracias por el dato.


La franja horaria es GMT -5. Ahora son las 10:06:31.

Desarrollado por: vBulletin® Versión 3.8.9
Derechos de Autor ©2000 - 2024, Jelsoft Enterprises Ltd.

DeNunCianDo.CoM ©

Page generated in 0,02529 seconds with 8 queries

SEO by vBSEO