View Single Post
  #1 (permalink)  
Old April 3rd, 2004, 10:11 AM
hdoldur hdoldur is offline
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default I cannot edit user details

I have user profile which is saved in a database and the code as follow:

register.asp




<BASEFONT FACE="Comic Sans MS" COLOR="DarkBlue">
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
<!--
  function VerifyData()
  {
// if (document.frmUser.Username.value == "" || document.frmUser.Password.value == "" ||
// document.frmUser.FirstName.value == "") {
// alert( "FirstName, Username or Password should not be blank" );
// return false;
// }
    if (document.frmUser.Username.value.toUpperCase() == "1BM1BM") {
        alert("Username already in use");
        return false;
    }
    if (document.frmUser.EMailAddress.value == "" ||
        document.frmUser.EMailAddress.value.indexOf ('@', 0) == -1) {
        alert("Enter a valid email address")
        document.frmUser.EMailAddress.focus()
        return false;
    }
    if (document.frmUser.Password.value != document.frmUser.VerifyPassword.value) {
        alert("Your passwords do not match - please reenter");
        document.frmUser.Password.focus()
        return false;
    }
    if (document.frmUser.Username.value.length < 5) {
        alert("Username must be at least 5 characters")
        document.frmUser.Username.focus()
        return false;
    }
    if (document.frmUser.Password.value.length < 5) {
        alert("Password must be at least 5 characters")
        document.frmUser.Password.focus()
        return false;
    }
      for (i=0; i<document.frmUser.length; i++)
        if (document.frmUser.elements[i].value == "" ||
            document.frmUser.elements[i].value == "Invalid") {
        // prompt("***Not all fields are entered***","You must enter all fields")
            alert("Not all fields are entered")
            document.frmUser.elements[i].focus()
            return false;
        }
    return true;
  }
-->
</SCRIPT>

<TITLE>Register.asp: User Registration</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<CENTER>

</CENTER>
<TABLE BORDER=0 WIDTH=100% BGCOLOR="e8f8f8">
  <TR ALIGN=CENTER>
  <TD><CENTER><H1>New User Registration</H1></CENTER></TD>
  </TR>
</TABLE>

<CENTER>(If you're already registered with us, then click the 'Login' link below.)</CENTER><P>You only need to register with our system if you want to use the personalised digital library. <BR> In order to use these services, please take a few minutes to complete the form below. Once you have done that, you will have full access to the system.




<FORM ACTION="AddUser.asp" NAME="frmUser" METHOD="POST"
              onSubmit="return VerifyData()">
  <TABLE BORDER=0 Width= 100% BGCOLOR="LightBlue">
    <TR>
      <TD WIDTH=20% ROWSPAN=11>&nbsp;</TD>
      <TD>First Name:</TD>
      <TD><INPUT TYPE="Text" NAME="FirstName" VALUE=""
           SIZE="40"></TD>
    </TR>
    <TR>
      <TD>Last Name:</TD>
      <TD><INPUT TYPE="Text" NAME="Surname" VALUE=""
           SIZE="40"></TD>
    </TR>
    <TR>
      <TD>Address:</TD>
      <TD><INPUT TYPE="Text" NAME="Address1" VALUE=""
           SIZE="40"></TD>
    </TR>
    <TR>
      <TD></TD>
      <TD><INPUT TYPE="Text" NAME="Address2" VALUE= ""
           SIZE="40"> </TD>
    </TR>
    <TR>
      <TD>City:</TD>
      <TD><INPUT TYPE="Text" NAME="City" VALUE= ""
           SIZE="40"> </TD>
    <TR>
      <TD>Post Code:</TD>
      <TD><INPUT TYPE="Text" NAME="PostCode" VALUE=""
           SIZE="40"></TD>
    </TR>
    <TR>
      <TD>Country:</TD>
      <TD><INPUT TYPE="Text" NAME="Country" VALUE=""
           SIZE="40"></TD>
    </TR>
    <TR>
      <TD>E-Mail Address:</TD>
      <TD><INPUT TYPE="Text" NAME="EMailAddress" VALUE=""
           SIZE="40"></TD>
    </TR>
     <TR>
      <TD>User Name:</TD>
      <TD><INPUT TYPE="Text" NAME="Username" VALUE=""
           SIZE="40"></TD>
    </TR>
   <TR>
      <TD>&nbsp;<P>Password:</TD>
      <TD VALIGN=bottom><INPUT TYPE="Password" NAME="Password"
                         VALUE="" SIZE="40"></TD>
    </TR>
    <TR>
      <TD>Verify Password:</TD>
      <TD><INPUT TYPE="Password" NAME="VerifyPassword" SIZE="40"></TD>
    </TR>
    <TR>
      <TD></TD>
      <TD ALIGN=CENTER COLSPAN=2><BR>
          <INPUT TYPE="Submit" VALUE="Submit Registration">
              &nbsp;&nbsp;<INPUT TYPE="RESET"></TD>
    </TR>
  </TABLE>
</FORM>


<TABLE BORDER=0 WIDTH=100% BGCOLOR="#e8f8f8">
  <TR ALIGN=CENTER>
    <TD WIDTH=33%>Registration</TD>
    <TD WIDTH=33%><A HREF="Login.asp">Login </A></TD>
    <TD WIDTH=33%><A HREF="Browse.asp">Browse the libary </A></TD
  </TR>
</TABLE>

</BODY>
</HTML>


and the Edituser.asp as follow to adeit the user details. I cannot reach to this code as follow:

<BASEFONT FACE="Comic Sans MS" COLOR="DarkBlue">
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
<!--
  function VerifyData()
  {
// if (document.frmUser.Username.value == "" || document.frmUser.Password.value == "" ||
// document.frmUser.FirstName.value == "") {
// alert( "FirstName, Username or Password should not be blank" );
// return false;
// }
    if (document.frmUser.Username.value.toUpperCase() == "1BM1BM") {
        alert("Username already in use");
        return false;
    }
    if (document.frmUser.EMailAddress.value == "" ||
        document.frmUser.EMailAddress.value.indexOf ('@', 0) == -1) {
        alert("Enter a valid email address")
        document.frmUser.EMailAddress.focus()
        return false;
    }
    if (document.frmUser.Password.value != document.frmUser.VerifyPassword.value) {
        alert("Your passwords do not match - please reenter");
        document.frmUser.Password.focus()
        return false;
    }
    if (document.frmUser.Username.value.length < 5) {
        alert("Username must be at least 5 characters")
        document.frmUser.Username.focus()
        return false;
    }
    if (document.frmUser.Password.value.length < 5) {
        alert("Password must be at least 5 characters")
        document.frmUser.Password.focus()
        return false;
    }
      for (i=0; i<document.frmUser.length; i++)
        if (document.frmUser.elements[i].value == "" ||
            document.frmUser.elements[i].value == "Invalid") {
        // prompt("***Not all fields are entered***","You must enter all fields")
            alert("Not all fields are entered")
            document.frmUser.elements[i].focus()
            return false;
        }
    return true;
  }
-->
</SCRIPT>

<TITLE>Register.asp: User Registration</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<CENTER>

</CENTER>
<TABLE BORDER=0 WIDTH=100% BGCOLOR="e8f8f8">
  <TR ALIGN=CENTER>
  <TD><CENTER><H1>Update User Registration</H1></CENTER></TD>
  </TR>
</TABLE>

Please change your registration information as listed below<P>


<FORM ACTION="EditUser.asp" NAME="frmUser" METHOD="POST"
              onSubmit="return VerifyData()">
  <TABLE BORDER=0 Width= 100% BGCOLOR="lightblue">
    <TR>
      <TD WIDTH=20% ROWSPAN=11>&nbsp;</TD>
      <TD>First Name:</TD>
      <TD><INPUT TYPE="Text" NAME="FirstName" VALUE=""
           SIZE="40"></TD>
    </TR>
    <TR>
      <TD>Last Name:</TD>
      <TD><INPUT TYPE="Text" NAME="Surname" VALUE=""
           SIZE="40"></TD>
    </TR>
    <TR>
      <TD>Address:</TD>
      <TD><INPUT TYPE="Text" NAME="Address1" VALUE=""
           SIZE="40"></TD>
    </TR>
    <TR>
      <TD>Address:</TD>
      <TD><INPUT TYPE="Text" NAME="Address2" VALUE=""
           SIZE="40"></TD>
    </TR>
    <TR>
      <TD>City:</TD>
      <TD><INPUT TYPE="Text" NAME="City" VALUE=""
           SIZE="40"></TD>
    </TR>
    <TR>
      <TD>Post Code:</TD>
      <TD><INPUT TYPE="Text" NAME="PostCode" VALUE=""
           SIZE="40"></TD>
    </TR>
    <TR>
      <TD>Country:</TD>
      <TD><INPUT TYPE="Text" NAME="Country" VALUE=""
           SIZE="40"></TD>
    </TR>
    <TR>
      <TD>E-Mail Address:</TD>
      <TD><INPUT TYPE="Text" NAME="EMailAddress" VALUE=""
           SIZE="40"></TD>
    </TR>
     <TR>
      <TD>User Name:</TD>
      <TD><INPUT TYPE="Text" NAME="Username" VALUE=""
           SIZE="40"></TD>
    </TR>
   <TR>
      <TD>&nbsp;<P>Password:</TD>
      <TD VALIGN=bottom><INPUT TYPE="Password" NAME="Password"
                         VALUE="" SIZE="40"></TD>
    </TR>
    <TR>
      <TD>Verify Password:</TD>
      <TD><INPUT TYPE="Password" NAME="VerifyPassword" SIZE="40"></TD>
    </TR>
    <TR>
      <TD></TD>
      <TD ALIGN=LEFT COLSPAN=2><BR>
          <INPUT TYPE="Submit" VALUE="Submit Registration">
              &nbsp;&nbsp;<INPUT TYPE="RESET"></TD>
    </TR>
  </TABLE>
</FORM>


<TABLE BORDER=0 WIDTH=100% BGCOLOR="#e8f8f8">
  <TR ALIGN=CENTER>
    <TD WIDTH=33%><A HREF="brows.asp">Brows the library</A></TD>
    <TD WIDTH=33%><A HREF="Login.asp">Login</A></TD>
    <TD WIDTH=33%>Registration</TD>
  </TR>
</TABLE>

</BODY>
</HTML>


Can you please help me how to edit the user details