- <html>
- <head>
- <title>Inscrire des données dans une BDD</title>
- </head>
- <body>
- <%
- If ("" & Request.Form("nom")) = "" then
- %>
-
- <table bgcolor="green" border="1" bordercolor="Blue" cellpadding="1" cellspacing="0">
- <form method="post" name="Form">
- <tr>
- <td>Login Souhaité:</td>
- <td><input type="text" name="login">
- </tr>
- <tr>
- <td>Mot de Passe:</td>
- <td><input type="password" name="password">
- </tr>
-
- <tr>
- <td>Votre nom:</td>
- <td><input type="text" name="nom">
- </tr>
- <tr>
- <td>Votre Prénom:</td>
- <td><input type="text" name="prenom"></td>
- </tr>
- <tr>
- <td>Votre numéro de téléphone:</td>
- <td><input type="text" name="fixe"></td>
- </tr>
- <tr>
- <td>Votre numéro de portable:</td>
- <td><input type="text" name="mobile"></td>
- </tr>
- <tr>
- <td>Votre Email:</td>
- <td><input type="text" name="email"></td>
- </tr>
- <tr>
- <td><input type="submit" value="Envoyer"></td>
- </tr>
- </form>
- </table>
-
- <%
- else
-
- Set oConn = Server.CreateObject("ADODB.Connection")
- ChConn = "dsn=[Votre_Base];uid=[Votre_Login];pwd=[Votre_Pass];"
- oConn.Open ChConn
-
- sLogin = Request.Form("login")
- sPassword = Request.Form("password")
- sNom = Request.Form("nom")
- sPrenom = Request.Form("prenom")
- sFixe = Request.Form("fixe")
- sMobile = Request.Form("mobile")
- sEmail = Request.Form("email")
-
- Req = "INSERT INTO TB_NDF_USER ([Nom_De_Champ1], [Nom_De_Champ2], [Nom_De_Champ3], [Nom_De_Champ4],[Nom_De_Champ5], [Nom_De_Champ6], [Nom_De_Champ7], [Nom_De_Champ8])"
- Req = Req & "VALUES ( '" & sLogin
- Req = Req & "', '" & sPassword
- Req = Req & "', '" & sNom
- Req = Req & "', '" & sPrenom
- Req = Req & "', '" & sFixe
- Req = Req & "', '" & sMobile
- Req = Req & "', '" & sEmail
- Req = Req & "', sysdate)"
-
- on error resume next
- oConn.execute Req
- If Err <>0 Then
- Response.Write Err.description
- Else
- Response.Write "Cet enregistrement a bien été ajouté"
- End If
- End if
- %>
- </body>
- </html>
<html>
<head>
<title>Inscrire des données dans une BDD</title>
</head>
<body>
<%
If ("" & Request.Form("nom")) = "" then
%>
<table bgcolor="green" border="1" bordercolor="Blue" cellpadding="1" cellspacing="0">
<form method="post" name="Form">
<tr>
<td>Login Souhaité:</td>
<td><input type="text" name="login">
</tr>
<tr>
<td>Mot de Passe:</td>
<td><input type="password" name="password">
</tr>
<tr>
<td>Votre nom:</td>
<td><input type="text" name="nom">
</tr>
<tr>
<td>Votre Prénom:</td>
<td><input type="text" name="prenom"></td>
</tr>
<tr>
<td>Votre numéro de téléphone:</td>
<td><input type="text" name="fixe"></td>
</tr>
<tr>
<td>Votre numéro de portable:</td>
<td><input type="text" name="mobile"></td>
</tr>
<tr>
<td>Votre Email:</td>
<td><input type="text" name="email"></td>
</tr>
<tr>
<td><input type="submit" value="Envoyer"></td>
</tr>
</form>
</table>
<%
else
Set oConn = Server.CreateObject("ADODB.Connection")
ChConn = "dsn=[Votre_Base];uid=[Votre_Login];pwd=[Votre_Pass];"
oConn.Open ChConn
sLogin = Request.Form("login")
sPassword = Request.Form("password")
sNom = Request.Form("nom")
sPrenom = Request.Form("prenom")
sFixe = Request.Form("fixe")
sMobile = Request.Form("mobile")
sEmail = Request.Form("email")
Req = "INSERT INTO TB_NDF_USER ([Nom_De_Champ1], [Nom_De_Champ2], [Nom_De_Champ3], [Nom_De_Champ4],[Nom_De_Champ5], [Nom_De_Champ6], [Nom_De_Champ7], [Nom_De_Champ8])"
Req = Req & "VALUES ( '" & sLogin
Req = Req & "', '" & sPassword
Req = Req & "', '" & sNom
Req = Req & "', '" & sPrenom
Req = Req & "', '" & sFixe
Req = Req & "', '" & sMobile
Req = Req & "', '" & sEmail
Req = Req & "', sysdate)"
on error resume next
oConn.execute Req
If Err <>0 Then
Response.Write Err.description
Else
Response.Write "Cet enregistrement a bien été ajouté"
End If
End if
%>
</body>
</html>