home *** CD-ROM | disk | FTP | other *** search
/ Freelog 9 / Freelog009.iso / BAS / Internet / Abb / dosubscribe.asp < prev    next >
Text File  |  2000-03-02  |  5KB  |  152 lines

  1. <% @ LANGUAGE="VBScript" lcid="1036" %>
  2. <!--#include file="include.asp"-->
  3. <%
  4.     Nom2=Replace(request.form("Nom"), "'", "''")
  5.     Passe2=Replace(request.form("Passe"), "'", "''")
  6.     Passepasse2=Replace(request.form("Passepasse"), "'", "''")
  7.     Email2=Replace(request.form("Email"), "'", "''")
  8.     Internet2=Replace(request.form("Internet"), "'", "''")
  9.     Occupation2=Replace(request.form("Occupation"), "'", "''")
  10.     Location2=Replace(request.form("Location"), "'", "''")
  11.     Interets2=Replace(request.form("Interets"), "'", "''")
  12.     ICQ2=Replace(request.form("ICQ"), "'", "''")
  13.     Signature2=Replace(request.form("Signature"), "'", "''")
  14.     Facul12=Replace(request.form("Facul1"), "'", "''")
  15.     Facul22=Replace(request.form("Facul2"), "'", "''")
  16.     Facul32=Replace(request.form("Facul3"), "'", "''")
  17.     Facul42=Replace(request.form("Facul4"), "'", "''")
  18.     Facul52=Replace(request.form("Facul5"), "'", "''")
  19.     vision2=request.form("vision")
  20.     cookie2=request.form("cookie")
  21.  
  22.     
  23.     If Nom2<>"" and Passe2<>"" and Passepasse2<>"" and Email2<>"" Then
  24.         If Passe2=Passepasse2 Then            
  25.             strAutSQL = "SELECT * FROM Utilisateur WHERE usrlogin='" & Nom2 & "' "
  26.             set AutRes=ConnectionBD.Execute(strAutSQL)
  27.             If AutRes.EOF = True Then
  28.                 If cookie2="Oui" Then
  29.                     Response.Cookies("abb").Expires = Now()
  30.                 Else
  31.                     Response.Cookies("abb")("nom") = Nom2
  32.                     Response.Cookies("abb")("passe") = Passe2
  33.                     Response.Cookies("abb")("vision") = vision2
  34.                     Response.Cookies("abb").Expires = Now() + 365
  35.                 End If
  36.             End If
  37.         End If
  38.     End If
  39.     
  40.     very=0
  41. %>
  42. <html>
  43.  
  44. <head>
  45. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  46. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  47. <meta name="ProgId" content="FrontPage.Editor.Document">
  48. <title>ABB</title>
  49. <style type="text/css">
  50. <!--
  51. A:link{text-decoration: none; color: <% =EnvironnementRes("envlnk") %>;}
  52. A:visited{text-decoration: none; color: <% =EnvironnementRes("envlnk") %>;}
  53. A:active{text-decoration: underline; color: <% =EnvironnementRes("envvlnk") %>;}
  54. A:hover{text-decoration: underline; color: <% =EnvironnementRes("envvlnk") %>;}
  55. -->
  56. </style>
  57. </head>
  58.  
  59. <body bgcolor="<% =EnvironnementRes("envback") %>" text="<% =EnvironnementRes("envtxt") %>" link="<% =EnvironnementRes("envlnk") %>" vlink="<% =EnvironnementRes("envvlnk") %>">
  60. <font face="Arial" size="2"><b>
  61. <% If Nom2="" or Passe2="" or Passepasse2="" or Email2="" Then %>
  62. <center>Remplissez tous les champs obligatoires SVP.</center>
  63. <%
  64. very=1
  65. temps=Now()
  66. While DateDiff("s",temps,Now())<3
  67. Wend
  68. %>
  69. <script language="javascript">
  70. history.back();
  71. </script>
  72. <% Else %>
  73. <% If Passe2<>Passepasse2 Then %>
  74. <center>Entrez le mΩme mot de passe dans les deux cases...</center>
  75. <%
  76. very=1
  77. temps=Now()
  78. While DateDiff("s",temps,Now())<3
  79. Wend
  80. %>
  81. <script language="javascript">
  82. history.back();
  83. </script>
  84. <% Else %>
  85. <%
  86. strAutSQL = "SELECT * FROM Utilisateur WHERE usrlogin='" & Nom2 & "' "
  87. set AutRes=ConnectionBD.Execute(strAutSQL)
  88. If AutRes.EOF = False Then
  89. %>
  90.     <center>DΘsolΘ, ce nom d'utilisateur est dΘjα pris...</center>
  91.     <%
  92.     very=1
  93. temps=Now()
  94. While DateDiff("s",temps,Now())<3
  95. Wend
  96.     %>
  97.     <script language="javascript">
  98.     history.back();
  99.     </script>
  100. <%
  101. End If
  102. %>
  103. <%
  104. If very=0 Then
  105.  
  106. longeur1=Len(Nom2)
  107. longeur2=Len(Passe2)
  108.  
  109. J=1
  110. For I=1 To longeur2
  111.     char1=Mid(Nom2,J,1)
  112.     char2=Mid(Passe2,I,1)
  113.     char3=Mid(Passe2,I,1)
  114.     code1=Asc(char1)
  115.     code2=Asc(char2)
  116.     code2=code2+code1
  117.     If code2>255 Then
  118.         code2=code2-255
  119.     End If
  120.     char2=Chr(code2)
  121.     Passe2=Replace(Passe2,char3,char2,1,1)
  122.  
  123.     J=J+1
  124.     If J>longeur1 Then
  125.     J=1
  126.     End If
  127. Next
  128. 'Cryptage du mot de passe
  129.  
  130. SQLStmt = "INSERT INTO Utilisateur (usrlogin,usrpass,usrstatu,usrmail,usrweb,usrocc,usrloc,usrint,usricq,usrsign,usrfacul1,usrfacul2,usrfacul3,usrfacul4,usrfacul5) "
  131. SQLStmt = SQLStmt & "VALUES ('" & Nom2 & "','" & Passe2 & "',3,'" & Email2 & "','" & Internet2 & "','" & Occupation2 & "','" & Location2 & "','" & Interets2 & "','" & ICQ2 & "','" & Signature2 & "','" & Facul12 & "','" & Facul22 & "','" & Facul32 & "','" & Facul42 & "','" & Facul52 & "')"
  132. Set RS=ConnectionBD.Execute(SQLStmt)
  133. %>
  134. <center>Bienvenue !<br><br>Vous allez automatiquement Ωtre ramenΘ sur le forum.<br>Sinon cliquez ici : <a href="default.asp">Retour au forum</a></center>
  135. <%
  136. temps=Second(now)
  137. temps=Now()
  138. While DateDiff("s",temps,Now())<3
  139. Wend
  140. %>
  141. <script language="javascript">
  142. document.location="default.asp";
  143. </script>
  144. </b></font>
  145. <% End If %>
  146. <% End If %>
  147. <% End If %>
  148. <!--#include file="basdepage.asp"-->
  149. </body>
  150.  
  151. </html>
  152.