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
| <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>
<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"
Set RS = server.createobject("ADODB.Recordset")
RS.Open SQL,Conn , 3, 3
'
<!-- ="commentaire" -->
' tant qu'il y a des fiches
while not RS.eof %>
<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
wend%>
</table>
</center>
</div>
<% ' Deconnexion
Conn.Close
SET Conn=Nothing %>
<!-- description du formulaire -->
<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" %><!--
' pour creation nouvelle ligne de table à partir du formulaire
' -------------------------------------------------------
RS.addnew
RS("nom")=Request.form("nom")
RS("message")=Request.form("message")
RS("mail")=Request.form("mail")
RS("dateL")=now()
RS.update
If nom <> "" then
' passage--><%
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
end if
%>
<% ' Deconnexion
Set RS=Nothing
nom=Nothing
Conn.Close
SET Conn=Nothing %> |
Partager