
21/09/2004, 09:18
|
 | | | Fecha de Ingreso: septiembre-2004 Ubicación: Gavilanes
Mensajes: 17
Antigüedad: 20 años, 7 meses Puntos: 0 | |
ya teneis el codigo He puesto todo el codigo espero que lo entedais, soy primerizo si engo errores tontos pido perdon
Gracias  . <html>
<!--#include file="./adovbs.inc"-->
<head>
<title>Tablon de Anuncios</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="108%" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="100%">
<h1 align="center"><font color="#FF0000" size="7"><strong><u>Tablón de
Anuncios</u></strong></font></h1>
</td>
</tr>
<tr>
<td width="100%"> </a> </td>
</tr>
<tr>
<td width="100%"> <p align="center"> <BR>
<%
Dim conexion
%>
<!--#include File="conectabd2.asp"-->
<%
conexion= Session("DbGeneral")
Dim sqltxt
Dim conn
Dim rst
Dim contador
sqltxt = "select * from anuncio;"
Set conn = Server.CreateObject("ADODB.Connection")
Conn.Open conexion
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open sqltxt, conn, adOpenStatic,adLockReadOnly,adCmdText
contador=rst.PageCount
If Contador = 0 Then
Response.Write "¡ No hay articulos que mostrar !"
Else
Do While Not( rst.EOF and rst.BOF)
%>
<table width="800" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td width="600" rowspan="2"><font face="Verdana" size="2
"><b><font color="#0000FF"><%=rst("titulo")%></font></b></font></td>
<td width="110">
<div align="right"><font color="#FF0000"><strong>Fecha:</strong></font></div></td>
<td width="90">
<div align="right"><font color="#FF0000"><strong> </strong></font><font face="Verdana" size="2"><b><font color="#336699"><%=rst("fecha")%></font></b></font></div></td>
</tr>
<tr>
<td width="110">
<div align="right"><font color="#FF0000"><strong>Nª Anuncio:</strong></font><font face="Verdana" size="2"><b></b></font></div></td>
<td width="90">
<div align="right"><font face="Verdana" size="2"><b><font color="#336699"><%=rst("id")%></font></b></font></div></td>
</tr>
</table>
<p> </p>
<p>
<% if rst("foto1")="0" and rst("foto2")="0" and rst("foto3")="0" then%>
</p>
<table width="800" height="" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="justify"><font face="Verdana, Helvetica, sans-serif, Arial" size="2"><b><font color="#336699"><%=rst("anuncio")%></font></b></font></div></td>
</tr>
</table>
<% else %>
<table width="800" height="96" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="380" rowspan="3" align="left" valign="top"><div align="justify"><font face="Verdana, Helvetica, sans-serif, Arial" size="2"><b><font color="#336699"><%=rst("anuncio")%></font></b></font></div></td>
<td width="40" height="64"> </td>
<% if rst("foto1")<>"0" then %>
<td width="380"><p><font face="Verdana, Helvetica, sans-serif, Arial" size="2"><b><img src="../fotos/fotos/<%=rst("foto1")%>" width="380" align="absmiddle"></font></p>
<p> </p></td>
<% end if %>
</tr>
<tr>
<td height="64"> </td>
<% if rst("foto2")<>"0" then %>
<td><p><font face="Verdana, Helvetica, sans-serif, Arial" size="2"><b><font color="#336699">
</font><font face="Verdana, Helvetica, sans-serif, Arial" size="2"><b><font color="#336699"><img src="../fotos/fotos/<%=rst("foto2")%>" width="380" align="right"></font></b></font><font color="#336699"></font></b></font>
<p> </p>
</td>
<% end if %>
</tr>
<tr>
<td height="64"> </td>
<% if rst("foto3")<>"0" then %>
<td width="380"><p> </p>
<p><img src="../fotos/fotos/<%=rst("foto3")%>" width="380"></p></td>
<% end if%>
</tr>
<% end if %>
</table>
<p> </p><p> </p><hr>
<p>
<%
rst.movenext
%>
<table width="800" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td width="600" rowspan="2"><font face="Verdana" size="2
"><b><font color="#0000FF"><%=rst("titulo")%></font></b></font></td>
<td width="110">
<div align="right"><font color="#FF0000"><strong>Fecha:</strong></font><font face="Verdana" size="2"><b></b></font></div></td>
<td width="90">
<div align="right"><font face="Verdana" size="2"><b><font color="#336699"><%=rst("fecha")%></font></b></font></div></td>
</tr>
<tr>
<td width="110">
<div align="right"><font color="#FF0000"><strong>Nº Anuncio:</strong></font><font face="Verdana" size="2"><b></b></font></div></td>
<td width="90">
<div align="right"><font face="Verdana" size="2"><b><font color="#336699"><%=rst("id")%></font></b></font></div></td>
</tr>
</table>
<p> </p>
<p>
<% if rst("foto1")="0" and rst("foto2")="0" and rst("foto3")="0" then%>
<font face="Verdana, Helvetica, sans-serif, Arial" size="2"><b></b></font>
</p>
<table width="800" height="" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="justify"><font face="Verdana, Helvetica, sans-serif, Arial" size="2"><b><font color="#336699"><%=rst("anuncio")%></font></b></font></div></td>
</tr>
</table>
<% else %>
<table width="800" height="96" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<% if rst("foto1")<>"0" then %>
<td width="380" align="left" valign="top"><p><font face="Verdana, Helvetica, sans-serif, Arial" size="2"><img src="../fotos/fotos/<%=rst("foto1")%>" width="380" align="absmiddle"></font></p>
<p> </p></td>
<% end if %>
<td width="40" height="64"> </td>
<td width="380" rowspan="3" align="left" valign="top"></font> <div align="justify"><font face="Verdana, Helvetica, sans-serif, Arial" size="2"><b><font color="#336699"><%=rst("anuncio")%></font></b></font></div></td>
</tr>
<tr>
<% if rst("foto2")<>"0" then %>
<td width="380" align="left" valign="top"><div align="left">
<p><font face="Verdana, Helvetica, sans-serif, Arial" size="2"><b><font color="#336699"><img src="../fotos/fotos/<%=rst("foto2")%>" width="380" align="right"></font></b></font></p>
</div><p> </p>
</td>
<% end if %>
<td height="64"> </td>
</tr>
<tr>
<% if rst("foto3")<>"0" then %>
<td width="380" align="left" valign="top"><p> </p>
<p><img src="../fotos/fotos/<%=rst("foto3")%>" width="380"></p></td>
<% end if%>
<td height="64"> </td>
</tr>
<% end if %>
</table>
<hr>
<%
rst.movenext
Loop
%>
<%
End If
rst.Close
Set rst = Nothing
Conn.Close
Set Conn = Nothing
%>
</p>
<p align="center"> </tr>
</table>
<p align="center"><a href="./insertanuncio.asp"><font color="#FF0000"><strong>Añadir
otro anuncio</strong></font></a></p>
<p align="center"><a href="../default.asp"><img src="../imagenes/flechaback.gif" width="21" height="22" border="0"></a></p>
</body>
</html> |