Forums

This topic is locked

Advanced Serverside Validation question

Posted 01 May 2003 04:27:58
1
has voted
01 May 2003 04:27:58 Phil Shevlin posted:
I am having a problem getting the last update to work. Heres my code:
<pre id=code><font face=courier size=2 id=code>
&lt;!--#include file="../Connections/cnRealSite.asp" --&gt;
&lt;!--#include file="../Connections/alfacheck.asp" --&gt;
&lt;%
if ((request.Form("ChangePassword" &lt;&gt; "" AND (alfaproceed &lt;&gt; "") then

Dim cmdPassword__UserEmail
cmdPassword__UserEmail = "0"
if(Session("MM_Username" &lt;&gt; "" then cmdPassword__UserEmail = Session("MM_Username"

Dim cmdPassword__UserPassword
cmdPassword__UserPassword = ""
if(Request("password" &lt;&gt; "" then cmdPassword__UserPassword = Request("password"

set cmdPassword = Server.CreateObject("ADODB.Command"
cmdPassword.ActiveConnection = MM_cnRealSite_STRING
cmdPassword.CommandText = "spUpdatePassword"
cmdPassword.Parameters.Append cmdPassword.CreateParameter("@RETURN_VALUE", 3, 4)
cmdPassword.Parameters.Append cmdPassword.CreateParameter("@UserEmail", 200, 1,50,cmdPassword__UserEmail)
cmdPassword.Parameters.Append cmdPassword.CreateParameter("@UserPassword", 200, 1,50,cmdPassword__UserPassword)
cmdPassword.CommandType = 4
cmdPassword.CommandTimeout = 0
cmdPassword.Prepared = true
cmdPassword.Execute()

dim msgPassword
msgPassword = "Password Changed."
end if
%&gt;
&lt;form action="" method="POST" name="formPassword" id="formPassword"&gt;
&lt;table width="300" align="center"&gt;
&lt;tr&gt;
&lt;td width="119" nowrap&gt; New Password:&lt;/td&gt;
&lt;td width="442"&gt; &lt;input name="password" type="password"&gt;&lt;input name="passwordFILLCNFM1" type="hidden" id="passwordFILLCNFM1"&gt;&lt;% if FindError(AlfaErrMsg,"password" = "True" then %&gt;&lt;div id="warning"&gt;Passwords don't match&lt;/div&gt;&lt;% end if %&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td nowrap&gt;Confirm Password&lt;/td&gt;
&lt;td&gt;&lt;input name="confirm" type="password" id="confirm" value=""&gt;&lt;input name="confirmFILLCNFM2" type="hidden" id="confirmFILLCNFM2"&gt;&lt;% if FindError(AlfaErrMsg,"confirm" = "True" AND FindError(AlfaErrMsg,"password" &lt;&gt; "True" then %&gt;&lt;div id="warning"&gt;Password can't be empty&lt;/div&gt;&lt;% end if %&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr align="center"&gt;
&lt;td colspan="2" nowrap&gt;&lt;%=(msgPassword)%&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr align="center"&gt;
&lt;td colspan="2" nowrap&gt;
&lt;input name="ChangePassword" type="hidden" id="changePassword" value="1"&gt;
&lt;input type="submit" value="Change Password"&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
</font id=code></pre id=code>

Reply to this topic