Ver Mensaje Individual
  #5 (permalink)  
Antiguo 01/02/2008, 16:21
Avatar de Shiryu_Libra
Shiryu_Libra
Colaborador
 
Fecha de Ingreso: febrero-2007
Ubicación: Cantando "Screenager" en "Kirafa Kaput"
Mensajes: 3.614
Antigüedad: 18 años, 2 meses
Puntos: 88
Re: rellenar un formulario

haber si te sirve esto
Código PHP:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
sub formulario(parametro)
select case 1%>
<
table width="599" border="0">
<
tr><td width="216" class="trebuchet13"><strong>
    <
label><span class="trebuchet13">Apellido</span></label></strong></td>
    <
td width="373"><input type="text" name="apellido" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>Nombre</strong></span></td>
    <
td><input type="text" name="nombres" /></td></tr>
<
tr><td class="trebuchet13"><strong>Edad</strong></td>
    <
td><input type="text" name="edad" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>Tipo de doc. </strong></span></td>
    <
td><span class="trebuchet13"><strong>
        <
input name="radio1" type="radio" value="DNI" />DNI
        
<input name="radio1" type="radio" value="CI" />CI
        
<input name="radio1" type="radio" value="LE" />LE
        
<input name="radio1" type="radio" value="Pasaporte" />Pasaporte
        
</strong></span></td></tr>
<
tr><td class="trebuchet13"><strong><label>N&degdoc. </label></strong></td>
    <
td><input type="text" name="numero" /></td></tr>
<
tr><td class="trebuchet13"><strong>C.U.I.L. </strong></td>
    <
td><input type="text" name="cuil" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>Estado Civil</strong></span></td>
    <
td><span class="Estilo4">
            <
label class="trebuchet13">
            <
input name="radio2" type="radio" value="Soltero/a" />Soltero/a
            
<input name="radio2" type="radio" value="Casado/a" />Casado/a
            
<input name="radio2" type="radio" value="Divorciado/a" />Divorciado/a
            
<input name="radio2" type="radio" value="Viudo/a" />Viudo/</label>
        </
span> </td></tr>
<
tr><td class="trebuchet13"><strong><label>Nacionalidad </label></strong></td>
    <
td><input type="text" name="nacionalidad" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>Direcci&oacute;n</strong></span></td>
    <
td><label><input type="text" name="direccion" /></label></td></tr>
<
tr><td class="trebuchet13"><strong><label>CodPostal </label></strong></td>
    <
td><input type="text" name="codpostal" /></td></tr>
<
tr><td class="trebuchet13"><strong><label>Tel Cel </label></strong></td>
    <
td><input type="text" name="cel" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>Tel&eacute;fono</strong></span></td>
    <
td><input type="text" name="tel" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>E-Mail</strong></span></td>
    <
td><input type="text" name="mail" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>Estudios cursados </strong></span></td>
    <
td><textarea name="estudios" cols="50" rows="5"></textarea></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>Otros estudios </strong></span></td>
    <
td><textarea name="otros" cols="50" rows="5"></textarea></td></tr>
<
tr><td class="trebuchet13"><strong><label>Idiomas </label></strong></td>
    <
td><label><textarea name="idiomas" cols="50" rows="5"></textarea></label></td></tr>
<
tr><td class="trebuchet13"><strong><label>Antecedentes laborales </label></strong></td>
    <
td><label><textarea name="antecedentes" cols="50" rows="5"></textarea></label></td></tr>
</
table><%
select case 2%>
<
table width="599" border="0">
<
tr><td width="216" class="trebuchet13"><strong>
    <
label><span class="trebuchet13">Apellido</span></label></strong></td>
    <
td width="373"><input type="text" name="apellido" value="<%=RS.fields.item("apellido")%>" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>Nombre</strong></span></td>
    <
td><input type="text" name="nombres" value="<%=RS.fields.item("nombres")%>" /></td></tr>
<
tr><td class="trebuchet13"><strong>Edad</strong></td>
    <
td><input type="text" name="edad" value="<%=RS.fields.item("edad")%>" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>Tipo de doc. </strong></span></td>
    <
td><span class="trebuchet13"><strong>
    <%
    
rad=RS.fields.item("radio1")
    
items="DNI,CI,LE,Pasaporte"
    
iterar=split(items,",")
    for 
i=0 to ubound(iterar)
        if 
rad=items(ithen%>
        <
input name="radio1" checked="checked" type="radio" value="<%=items(i)%>" /><%=items(i)%><%        else
        %><
input name="radio1" type="radio" value="<%=items(i)%>" /><%=items(i)%><%
        
end if
        
next
        redim iterar
(0)%></strong></span></td></tr>
<
tr><td class="trebuchet13"><strong><label>N&degdoc. </label></strong></td>
    <
td><input type="text" name="numero" value="<%=RS.fields.item("numero")%>" /></td></tr>
<
tr><td class="trebuchet13"><strong>C.U.I.L. </strong></td>
    <
td><input type="text" name="cuil" value="<%=RS.fields.item("cuil")%>" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>Estado Civil</strong></span></td>
    <
td><span class="Estilo4">
            <
label class="trebuchet13">    <%
    
rad=RS.fields.item("radio2")
    
items="Soltero/a,Casado/a,Divorciado/a,Viudo/a"
    
iterar=split(items,",")
    for 
i=0 to ubound(iterar)
        if 
rad=items(ithen%>
        <
input name="radio2" checked="checked" type="radio" value="<%=items(i)%>" /><%=items(i)%><%        else
        %><
input name="radio2" type="radio" value="<%=items(i)%>" /><%=items(i)%><%
        
end if
        
next%></label></span></td></tr>
<
tr><td class="trebuchet13"><strong><label>Nacionalidad </label></strong></td>
    <
td><input type="text" name="nacionalidad" value="<%=RS.fields.item("nacionalidad")%>" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>Direcci&oacute;n</strong></span></td>
    <
td><label><input type="text" name="direccion" value="<%=RS.fields.item("direccion")%>" /></label></td></tr>
<
tr><td class="trebuchet13"><strong><label>CodPostal </label></strong></td>
    <
td><input type="text" name="codpostal" value="<%=RS.fields.item("codpostal")%>" /></td></tr>
<
tr><td class="trebuchet13"><strong><label>Tel Cel </label></strong></td>
    <
td><input type="text" name="cel" value="<%=RS.fields.item("cel")%>" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>Tel&eacute;fono</strong></span></td>
    <
td><input type="text" name="tel" value="<%=RS.fields.item("tel")%>" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>E-Mail</strong></span></td>
    <
td><input type="text" name="mail" value="<%=RS.fields.item("mail")%>" /></td></tr>
<
tr><td class="trebuchet13"><span class="Estilo13"><strong>Estudios cursados </strong></span></td>
    <
td><textarea name="estudios" cols="50" rows="5"><%=RS.fields.item("estudios")%>" </textarea></td></tr>
<tr><td class="
trebuchet13"><span class="Estilo13"><strong>Otros estudios </strong></span></td>
    <td><textarea name="
otros" cols="50" rows="5"><%=RS.fields.item("otros")%></textarea></td></tr>
<tr><td class="
trebuchet13"><strong><label>Idiomas </label></strong></td>
    <td><label><textarea name="
idiomas" cols="50" rows="5"><%=RS.fields.item("idiomas")%></textarea></label></td></tr>
<tr><td class="
trebuchet13"><strong><label>Antecedentes laborales </label></strong></td>
    <td><label><textarea name="
antecedentes" cols="50" rows="5">value="<%=RS.fields.item("antecedentes")%>" </textarea></label></td></tr>
</table><%
    end select
end sub

sub consulta(criterio)
Query="
select " & campos & " from TUTABLA where nombre '" & criterio & "'"
set RS=conexion.execute(Query)
if Err=0 then
    if RS.EOF=False then
        formulario 2
    else
        Response.Write "
No se encontraron datos para este criterio (" & crierio & ")"
    end if
else
    Response.Write "
No se puede concretar la busquedaHa axistido un Errorllame a su AdministraroErro:" & Err
end if
set RS=nothing
conexion.close
set conexion= nothing
end sub%>
<!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=utf-8" />
<
title>Documento sin t&iacute;tulo</title>
</
head>

<
body>
<%
if 
request.ServerVariables("REQUEST_METHOD")="POST" then
    strconsulta
=request.form("campo"'<--- MODIFICA ESTE CAMPO POR EL DE TU FORMULARIO
    if isnull(strconsulta) or isempty(strconsulta) then
        formulario 1
    else
        consulta(strconsulta)
    end if
elseif request.ServerVariables("REQUEST_METHOD")="GET" then
    criterio=request.QueryString("campo") '
<--- MODIFICA ESTE CAMPO POR EL DE TU FORMULARIO
    
if isnull(strconsulta) or isempty(strconsultathen
        formulario 1
    
else
        
consulta(strconsulta)
    
end if
end if
%>
</
body>
</
html
__________________
"Eres parte del problema, parte de la solucion o parte del paisaje"
Un Saludo desde Desierto de Altar, Sonora, MX.
Shiryu_libra