Foros del Web » Programando para Internet » ASP Clásico »

campo en blanco en aviso clasificado...

Estas en el tema de campo en blanco en aviso clasificado... en el foro de ASP Clásico en Foros del Web. Hola gente, soy nuevo con esto de asp pero tengo un sitio que alguien creo, y que otro modificó ... el problema es que tiene ...
  #1 (permalink)  
Antiguo 16/04/2008, 19:45
 
Fecha de Ingreso: abril-2008
Mensajes: 7
Antigüedad: 17 años
Puntos: 0
Pregunta campo en blanco en aviso clasificado...

Hola gente, soy nuevo con esto de asp pero tengo un sitio que alguien creo, y que otro modificó... el problema es que tiene un formulario que se llena, algo parecido a esto:

contenido=contenido &"DATOS NUEVO AVISO"
contenido=contenido &"Nombre: " &txt_nombre& " " &txt_apellido &chr(10)&chr(13)
contenido=contenido &"Email: " &txt_apellido &chr(10)&chr(13)
contenido=contenido &"Telefono: " &txt_telefono &chr(10)&chr(13)
contenido=contenido &"Localidad: " &txt_localidad &chr(10)&chr(13)
contenido=contenido &"Rubro-Subrubro-Item: " &title1&"-"&title2&"-"&title3 &chr(10)&chr(13)
contenido=contenido &"Texto Aviso: " &txt_texto &chr(10)&chr(13)
contenido=contenido &"Foto: " & foto &chr(10)&chr(13)
contenido=contenido &"Numero Aviso: " &numero_aviso

y de aqui va a una pagina de intranet, donde el administrador lo lee, y si no es nada desubicado , se publica, para lo cual el mensaje va a parar a una base acces y otra pagina lo muestra... el problema es que en esta ultima pagina no muestra el campo nombre, y por lo que pude ver el mismo aparece vacio en la base de datos... y no se donde esta la falla ayuda por favor!!! gracias por lo que puedan pasar

Última edición por lucancheta; 16/04/2008 a las 20:14 Razón: escribi el titulo mal...
  #2 (permalink)  
Antiguo 17/04/2008, 01:13
Avatar de i_e_s27  
Fecha de Ingreso: marzo-2008
Ubicación: En mi casa
Mensajes: 208
Antigüedad: 17 años, 1 mes
Puntos: 5
Re: campo en blanco en aviso clasificado...

Cuando envian el form, al administrador que se fija que no han escrito nada desubicado, le llega el campo Nombre?

Si la respuesta es NO:

Muestranos mas codigo; en la pagina que envia el form y la que recibe los datos.

Si la respuesta es SI:

Muestranos la pagina que usa el admin para guardar la info en la base de datos.


Saludos!
  #3 (permalink)  
Antiguo 17/04/2008, 04:15
 
Fecha de Ingreso: abril-2008
Mensajes: 7
Antigüedad: 17 años
Puntos: 0
Re: campo en blanco en aviso clasificado...

Si, al administrador le llegan todos los campos, pero cuando acepta, se pierde el del nombre... mira:

response.expires=0
Response.CacheControl="no-cache"
dim directorio
dim barradir
'barradir="../"
barradir="/"
directorio=barradir&"fpdb/"

if session("user")=0 then
Response.Redirect "index.asp"
end if
if session("user")=1 then
dim acciones'recupera el valor de main.asp para ver que se va a hacer
dim mostrar_acciones'true si puede mostrar los botones de activar y borrar
acciones=trim(Request.Form("acciones"))
mostrar_acciones=false
dim accion'recupera el valor de doit.asp si hay que borrar, activar, prolongar o continuar
dim cid'recupera el valor de los cuadro seleccionados
accion=trim(Request.Form("accion"))
cid=trim(Request.Form("cid"))
dim numpagina'numero de pagina
numpagina=trim(request.form("pnum"))

if numpagina="" then
numpagina=1
else
if not isnumeric(numpagina) then
numpagina=1
else
numpagina=cint(numpagina)
end if
end if

if acciones="salir" then
Response.Redirect "logout.asp"
'elseif acciones="exportar" then
' response.Redirect "exportaremails.asp"
elseif acciones="activar" then
db_sql = "SELECT * FROM avisos WHERE mostrar = false ORDER BY id ASC"
if accion="continuar" then
Response.Redirect "main.asp"
end if
elseif acciones="depurar" then
db_sql="SELECT * FROM avisos WHERE mostrar = true AND fecha_alta < DATE()-15 ORDER BY id ASC"
if accion="continuar" then
Response.Redirect "main.asp"
end if
elseif acciones="listado" then
db_sql="SELECT * from avisos WHERE mostrar = true ORDER BY id ASC"
if accion="continuar" then
Response.Redirect "main.asp"
end if
end if

'INICIO apertura DBs
set db_sitio=server.CreateObject("ADODB.recordset")
db_sitio.cursortype= 1
db_sitio.locktype=3
db_sitio.PageSize=25
'db_sql = "SELECT * FROM avisos WHERE mostrar = false ORDER BY id ASC"
'e="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="& Server.MapPath(directorio&"dbavisos.mdb")
e="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=I:\FerozoWebHosting\clasificadosglobo .com.ar\public_html\fpdb\dbavisos.mdb"
db_sitio.open db_sql, e
if not db_sitio.BOF and not db_sitio.EOF then
db_sitio.AbsolutePage=numpagina
end if

'FIN apertura DBs

dim msg'texto si fue todo ok o no
msg=""
if acciones="activar" then
'INICIO acciones
if accion="activar" then
call proceder(accion)
elseif accion="borrar" then
call proceder(accion)
end if
'FIN acciones
elseif acciones="depurar" then
'INICIO depurar
if accion="prolongar" then
call proceder(accion)
elseif accion="borrar" then
call proceder(accion)
end if
'FIN depurar
elseif acciones="listado" then
'INICIO listado
if accion="borrar" then
call proceder(accion)
end if
'FIN listado
end if
end if


sub proceder(action)
if cid <> "" then
dim long_cid
dim id
dim ultimo'si es el ultimo numero de aviso que hay en la variable
ultimo=false
id=""
long_cid=len(cid)
do until instr(1,cid,",")<0
if instr(1,cid,",")=0 then
id=cid
if ultimo then
exit do
end if
ultimo=true
else
id=left(cid,instr(1,cid,",")-1)
cid=right(cid,long_cid-instr(1,cid,",")-1)
long_cid=len(cid)
end if
db_sitio.MoveFirst()
do until db_sitio.EOF
if clng(db_sitio("id"))=clng(right(id,len(id)-3)) then
if accion="activar" then
db_sitio("fecha_alta")=date()
db_sitio("mostrar")=true
db_sitio.Update()
exit do
elseif accion="prolongar" then
db_sitio("fecha_alta")=date()
db_sitio.Update()
exit do
elseif accion="borrar" then
db_sitio.Delete
db_sitio.Update()
exit do
end if
end if
db_sitio.MoveNext()
loop
loop
msg="La acción se ha completado con Exito."
else
msg="No se han seleccionado ningún Aviso."
end if
end sub

No pude cargar la pagina entera xq era muy largo... dime como hago para pasarte el archivo completo...
Gracias!
  #4 (permalink)  
Antiguo 17/04/2008, 06:46
Avatar de i_e_s27  
Fecha de Ingreso: marzo-2008
Ubicación: En mi casa
Mensajes: 208
Antigüedad: 17 años, 1 mes
Puntos: 5
Re: campo en blanco en aviso clasificado...

Si no te entra la pagina entera ponlo de varios post, y prefentemente entre etiquetas [CODE] asi queda mejor

Tu dices que no guarda el campo "Nombre"... pues en ningun lado veo la palabra Nombre ni menos algo como db_sitio("nombre")
  #5 (permalink)  
Antiguo 17/04/2008, 08:17
 
Fecha de Ingreso: abril-2008
Mensajes: 7
Antigüedad: 17 años
Puntos: 0
Re: campo en blanco en aviso clasificado...

parte 1:
Código PHP:
<script language="javascript">
<!--
function 
do_accion(accion){
    if(
accion!=""){
        
document.frm_accion.accion.value=accion;
        
document.frm_accion.submit();
    }
}
function 
change_page(numero){
    if(
numero!=""){
        
document.frm_accion.pnum.value=numero;
        
document.frm_accion.submit();
    }
}
function 
MM_swapImgRestore() { //v3.0
  
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function 
MM_preloadImages() { //v3.0
  
var d=document; if(d.images){ if(!d.MM_pd.MM_p=new Array();
    var 
i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0i<a.lengthi++)
    if (
a[i].indexOf("#")!=0){ d.MM_p[j]=new Imaged.MM_p[j++].src=a[i];}}
}

function 
MM_findObj(nd) { //v4.0
  
var p,i,x;  if(!dd=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    
d=parent.frames[n.substring(p+1)].documentn=n.substring(0,p);}
  if(!(
x=d[n])&&d.allx=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(
i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!
&& document.getElementByIdx=document.getElementById(n); return x;
}

function 
MM_swapImage() { //v3.0
  
var i,j=0,x,a=MM_swapImage.argumentsdocument.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((
x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrcx.oSrc=x.srcx.src=a[i+2];}
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="doit.asp_files/estilo.css" type="text/css"></head><body onload="MM_preloadImages('../images/work/b_agregar_f2.gif','../images/work/b_contacto_f2.gif')" bgcolor="#e9e9e9" text="#000000">
<table border="0" cellpadding="0" cellspacing="0" height="98%" width="100%">
  <tbody><tr>
    <td valign="top"> 
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tbody><tr>
          <td>
            <table name="superior" border="0" cellpadding="0" cellspacing="0" width="100%">
              <tbody><tr>
                <td align="center"> 
                  <table name="logo" border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tbody><tr>
                      <td width="250"><img src="doit.asp_files/logo2.gif" border="0" height="60" width="250"></td>
                      <td>&nbsp;</td>
                    </tr>
                  </tbody></table>
                  <table name="barra_sup" bgcolor="#dbdbb7" border="0" cellpadding="0" cellspacing="0" width="90%">
                    <tbody><tr> 
                      <td width="9"><img src="doit.asp_files/borde_izq.gif" height="18" width="9"></td>
                      <td>
                        <table class="seccionfecha" border="0" cellpadding="0" cellspacing="0" width="100%">
                          <tbody><tr>
                            <td class="titulo_listado">&nbsp;</td>
                            <td align="right" width="300">17 de Abril de 2008</td>
                          </tr>
                        </tbody></table>
                      </td>
                      <td width="9"><img src="doit.asp_files/borde_der.gif" height="18" width="9"></td>
                    </tr>
                  </tbody></table>
                </td>
              </tr>
            </tbody></table>
          </td>
        </tr>
        <tr>
          <td> <br>
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tbody><tr> 
                <td width="120">&nbsp; </td>
                <td> 
                  
                  <form name="frm_accion" method="post" action="doit.asp">
                    <br>
                    
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                      <tbody><tr> 
                        <td width="10%">&nbsp;</td>
                        <td width="80%"> 
                          <table border="0" cellpadding="0" cellspacing="0" width="100%">
                            <tbody><tr> 
                              <td> 
                                <table name="tb_rubro" border="0" cellpadding="0" cellspacing="0" width="100%">
                                  <tbody><tr> 
                                    <td> 
                                      <table class="titulo_tablas" border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <tbody><tr> 
                                          <td bgcolor="#cccccc" width="350">&nbsp;Listado 
                                            de Avisos NO publicados</td>
                                          <td align="left"><img 
  #6 (permalink)  
Antiguo 17/04/2008, 08:19
 
Fecha de Ingreso: abril-2008
Mensajes: 7
Antigüedad: 17 años
Puntos: 0
Re: campo en blanco en aviso clasificado...

parte 2:

Código PHP:
src="doit.asp_files/angulo.gif" height="26" width="40"></td>
                                        </
tr>
                                      </
tbody></table>
                                    </
td>
                                  </
tr>
                                  <
tr
                                    <
td
                                      <
table border="1" bordercolor="#cccccc" cellpadding="3" cellspacing="0" width="100%">
                                        <
tbody><tr
                                          <
td
                                            
                                            <
table bgcolor="#cccccc" border="1" bordercolor="#666666" cellpadding="0" cellspacing="0" width="100%">
                                              <
tbody><tr
                                                <
td
                                                  <
table class="texto_aviso" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <
tbody><tr
                                                      <
td class="texto_nroaviso" width="80">&nbsp;VHZ3646 </td>
                                                      <
td>zgfdvxcvzvz xcgvcxbxvc 353456 sdjhsdjsd</td>
                                                      <
td align="center" width="50">Foto<br>
                                                        
SI
                                                      
</td>
                                                      <
td align="center" width="50">Fecha<br>
                                                        </
td>
                                                      <
td align="center" width="50"
                                                        <
input name="cid" value="VHZ3646" type="checkbox">
                                                      </
td>
                                                    </
tr>
                                                  </
tbody></table>
                                                </
td>
                                              </
tr>
                                            </
tbody></table>
                                            
                                            
                                            <
table bgcolor="#cccccc" border="1" bordercolor="#666666" cellpadding="0" cellspacing="0" width="100%">
                                              <
tbody><tr
                                                <
td
                                                  <
table class="texto_aviso" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <
tbody><tr
                                                      <
td class="texto_nroaviso" width="80">&nbsp;AAO3647 </td>
                                                      <
td>xzgv mngd luca 21654 zb</td>
                                                      <
td align="center" width="50">Foto<br>
                                                        
NO
                                                      
</td>
                                                      <
td align="center" width="50">Fecha<br>
                                                        </
td>
                                                      <
td align="center" width="50"
                                                        <
input name="cid" value="AAO3647" type="checkbox">
                                                      </
td>
                                                    </
tr>
                                                  </
tbody></table>
                                                </
td>
                                              </
tr>
                                            </
tbody></table>
                                            
                                            
                                            <
table bgcolor="#cccccc" border="1" bordercolor="#666666" cellpadding="0" cellspacing="0" width="100%">
                                              <
tbody><tr
                                                <
td
                                                  <
table class="texto_aviso" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <
tbody><tr
                                                      <
td class="texto_nroaviso" width="80">&nbsp;AAC3648 </td>
                                                      <
td>ad asd das ddd</td>
                                                      <
td align="center" width="50">Foto<br>
                                                        
SI
                                                      
</td>
                                                      <
td align="center" width="50">Fecha<br>
                                                        </
td>
                                                      <
td align="center" width="50"
                                                        <
input name="cid" value="AAC3648" type="checkbox">
                                                      </
td>
                                                    </
tr>
                                                  </
tbody></table>
                                                </
td>
                                              </
tr>
                                            </
tbody></table>
                                            
                                            
                                            <
table bgcolor="#cccccc" border="1" bordercolor="#666666" cellpadding="0" cellspacing="0" width="100%">
                                              <
tbody><tr
                                                <
td
                                                  <
table class="texto_aviso" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <
tbody><tr
                                                      <
td class="texto_nroaviso" width="80">&nbsp;AAO3655 </td>
                                                      <
td>aca va texto luca 21544 dfhbcfnj</td>
                                                      <
td align="center" width="50">Foto<br>
                                                        
NO
                                                      
</td>
                                                      <
td align="center" width="50">Fecha<br>
                                                        </
td>
                                                      <
td align="center" width="50"
                                                        <
input name="cid" value="AAO3655" type="checkbox">
                                                      </
td>
                                                    </
tr>
                                                  </
tbody></table>
                                                </
td>
                                              </
tr>
                                            </
tbody></table>
                                            
                                            
                                            <
table border="0" cellpadding="0" cellspacing="0" width="100%">
                                              <
tbody><tr>
                                                <
td align="center">
                                                
                                                        <
font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>1</b></font>
                                                    
                                                </
td>
                                              </
tr>
                                            </
tbody></table>
                                            &
nbsp;<br>
                                            
                                          </
td>
                                        </
tr>
                                      </
tbody></table>
                                    </
td>
                                  </
tr>
                                  <
tr
                                    <
td align="center"
                                      
                                      <
br>
                                      <
input name="b_activar" value="Activar" onclick="javascript:do_accion('activar');" class="botones" type="button">
                                      <
input name="b_borrar" value="Borrar" onclick="javascript:do_accion('borrar');" class="botones" type="button">
                                      
                                      <
input name="b_continuar" value="Continuar" onclick="javascript:do_accion('continuar');" class="botones" type="button">
                                    </
td>
                                  </
tr>
                                </
tbody></table>
                              </
td>
                            </
tr>
                          </
tbody></table>
                        </
td>
                        <
td width="10%">&nbsp;</td>
                      </
tr>
                    </
tbody></table>
                    
                    <
input name="accion" value="" type="hidden">
                    
                    <
input name="acciones" value="activar" type="hidden">
                    <
input name="pnum" value="" type="hidden">
                    
                  </
form>
                  
                </
td>
                <
td align="center" width="120">&nbsp;</td>
              </
tr>
            </
tbody></table>
          </
td>
        </
tr>
      </
tbody></table>
      
    </
td>
  </
tr>
</
tbody></table>
</
body></html
este es el code de la pagina.. no le veo la falla.. estarà antes? pasa que aqui muestra la ventana con todos los datos.. y despues de aqui la publica con un dato menos..
saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:09.