1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
| <html>
<head>
<meta http-equiv="Content-Language" content="fr">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>livredor2</title>
</head>
<body>
<%
' Création de l'objet permettant la connexion
Set Conn = Server.CreateObject("ADODB.Connection")
' Connexion
Conn.Open "test"%> <img border="0" src="livre.jpg">
<p> </p>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; font-family:Verdana; font-size:8pt" bordercolor="#111111" width="411" id="AutoNumber1" bordercolorlight="#FF00FF">
<tr>
<td width="51"><font color="#0000FF">id-message</font></td>
<td width="71"><font color="#0000FF">nom</font></td>
<td width="109"><font color="#0000FF">message</font></td>
<td width="51"><font color="#0000FF">date</font></td>
<td width="123"><font color="#0000FF">adresse-mail</font></td>
</tr>
<%' Sélectionne toutes les fiches de la table "TLivre"
SQL="SELECT * FROM TLivre"
' indiquer le nombre de lignes par page
Set RS = server.createobject("ADODB.Recordset")
RS.Open SQL,Conn , 3, 3
'
<!-- ="commentaire" -->
' tant qu'il y a des fiches
' pour pagination :
' nbp : Nombre de lignes par page
' i = indice pour compter les lignes
' num =
nbp = 6
num=cint(request.queryString("i"))%>
<BR> <%response.write "i= "%> <%=i%> </BR>
<%response.write "num avant le test = "%> <%=num%>
<% if num = 0 then
i=0 'compteur du nombre de messages
end if%>
<BR>
<%response.write "i avant la boucle = "%> <%=i%> </BR>
<%response.write "num apres le test= "%> <%=num%>
<BR>
<%response.write " nbp+num= "%> <%=nbp+num%> </BR>
<% while not RS.eof and i<nbp+num%>
<!--' while not RS.eof and i<10-->
<tr>
<td width="51"><%=RS("N°")%></a> </td>
<td width="71"><%=RS("nom")%></a> </td>
<td width="109"><%=RS("message")%> </td>
<td width="51"><%=RS("dateL")%></a> </td>
<td width="123"><%=RS("mail")%> </td>
<!--webbot bot="PurpleText" PREVIEW="commentaire" -->
</tr>
<%
RS.MOVENEXT ' fiche suivante
i=i+1
wend%>
<BR>
<%response.write "i apres la boucle = "%> <%=i%>
</BR>
<% if not RS.eof then%>
<A href="?num=<%=i%>"> Suite </A>
<%end if%>
</table>
</center>
</div>
<% ' Deconnexion
Conn.Close
SET Conn=Nothing %>
<!-- description du formulaire --> <p align="right">
<span style="text-decoration: blink">
<a href="livredor2.asp?num=i">
<font face="Verdana" size="1" color="#008000">Suite</font></a></span></p>
<p> </p>
<p align="center"><font face="Verdana" size="2">Ajouter des données à la base</font></p>
<form method="POST" action="livredor2.asp">
<p align="center"> </p>
<!-- <p align="left"><font face="Verdana" size="2">Votre nom :</font>-->
<input type="hidden" name="N°" value="0">
<p align="left"><font face="Verdana" size="2">Votre nom :</font>
<input type="text" name="nom" size="20"></p>
<p align="left"><font face="Verdana" size="2">Votre message : </font>
<input type="text" name="message" size="50"></p>
<p align="left"><font face="Verdana" size="2">votre mail :
<input type="text" name="mail" size="30"></font></p>
<p align="left"><input type="submit" value="Envoyer" name="action">
<input type="reset" value="Rétablir" name="B2"></p>
</form>
<p align="center"> </p>
<p align="center"> </p>
<p> </p>
</body>
</html>
<!-- recuperation donnees formulaire --><% ' Création de l'objet permettant la connexion
Set Conn = Server.CreateObject("ADODB.Connection")
' Connexion
Conn.Open "test" %>
<%
nom=Request.form("nom")
message=Request.form("message")
mail=Request.form("mail") %><% if nom<>"" then%><% RequeteSQL = "Insert into TLivre (nom, message, dateL,mail) Values ('"&nom&"','"&message&"','"&now()&"','"&mail&"')"
Set RS = server.createobject("ADODB.Recordset")
RS.Open RequeteSQL,Conn , 3, 3
response.redirect("livredor2.asp")
%><%end if %><% ' Deconnexion
Set RS=Nothing
Set nom=Nothing
Conn.Close
Request.form("nom")
SET Conn=Nothing %> |
Partager