Bonjour à tous j'ai 1 probleme :
1/
J'ai recuperer un script ou une page inscriptionprocess.asp recupere les donnees d'un formulaire de la page inscription.asp (nom, prenom, password, email)
Dans une page il y a la fonction suivante :
*************************************************
For Each key in Request.Form
strName = key
strValue = Request.Form(key)
Session(strName) = strValue
Next
strUserID = Request.Form("strName")
strPass1 = Request.Form("strPass1")'pour le password
strPass2 = Request.Form("strPass2") 'confirmation du password
strFirst = Request.Form("strFirst")'nom
strLast = Request.Form("strLast")'prenom
strEmail = Request.Form("strEmail")
strAdmin = "admin"
On Error Resume Next
if strPass1 = strPass2 then
set Conn = Server.CreateObject("ADODB.Connection")
Conn.open ConString
set rsInsert = Server.CreateObject("ADODB.RecordSet")
rsInsert.Open "admin", Conn, adOpenStatic, adCmdTable
rsInsert.AddNew
rsInsert("username") = strUserID
rsInsert("password") = strPass1
rsInsert("fName") = strFirst
rsInsert("lName") = strLast
rsInsert("email") = strEmail
rsInsert("users") = strAdmin
rsInsert.Update
rsInsert.Close
set rsInsert = Nothing
Conn.close
set Conn = Nothing
if Err.number = 0 then
'everything is OK
%>
<h3>Admin Registration<h3>
<p class="header"><font size="2"><b>Your registration was successful!</b></font></p>
<p class="header"><font size="2"><b><a href="adminLogin.asp">Go to Login Page</a></b></font></p>
<%
else
'There was a problem with the registration
%>
<p class="header"><font size="4"><b>Problem</b></font></p>
<p class="header"><font size="2"><b>There was a problem with your registration.<br>
Please go back and choose a different username.</b></font></p>
****************************************************
Mais voila j'ai beau entrer les donnees pour faire un enregistrement j'ai toujours la reponse "There was a problem with your registration.
Please go back and choose a different username"
alors que ma BD est vide.
J'ai testé les variables suivantes key ; rtrName et request.form(key) en voulant les afficher avec response.write (response.write(request.form(key)); response.write(strName) ; response.write(key) et voici le resultat:
==> la ligne 'response.write(request.form(key))' a disparu
resultat srtName : submit1
resultat key :
Si je peuvais avoir un debut d'explication je suis preneur
d'avance merci!
Partager