How to add an action to our Activate part using ASP?

Stiebel Eltron
Stiebel Eltron used Ask the Experts™
on
</head>

<body bgproperties="fixed" bgcolor="#000000" onLoad="javascript:startmenu()">

<%
	Dim myConnection
	Dim rsUsers
	Dim connectString
	Dim sqlString
	Dim requestName

	connectString = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=DBSERVER; PORT=3306; DATABASE=DB; USER=DBUSER; PASSWORD=DBPW; OPTION=0;"

	Set myConnection = Server.CreateObject("ADODB.Connection")
	Set rsUsers = Server.CreateObject("ADODB.Recordset")

	myConnection.Open connectString

	requestName = Request.Form("USERID")
	response.Write(requestName)

	sqlString = "Select * From users WHERE ID = 1"
	
	Set rsUsers = myConnection.Execute(sqlString)

%>

<table width="760" border="0" cellspacing="3" cellpadding="1">
  <tr>
    <td width="134"><img src="../IMG/logo_res.jpg" alt="STIEBEL ELTRON" /></td>
    <td width="620" valign="top" bgcolor="#666666"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="548" height="197">
      <param name="movie" value="homeintro20.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <embed src="homeintro20.swf" quality="high" wmode="opaque" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="548" height="197"></embed>
    </object></td>
    <td width="134" bgcolor="#FFFFFF"><img src="../IMG/RegIcon.png" alt="ASIA" border="0" align="top"/></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="right" bgcolor="#999999"><font face="Verdana, Geneva, sans-serif" color="#ffffff">
    <%
   '// If user is logged in show name and logout link
   If Session("loggedin") = true Then
      Response.Write "Welcome: " & Session("FName")
      Response.Write "<br /><a href=""../asia2/login/logout.asp"">Logout</a>"
   Else
      Response.Write "<a href=""../ste-iphoto-login2.asp"" title=""CLICK TO LOGIN"">REGISTERED USERS</a>"
   End If
	%>&nbsp;
	</td>
    <td bgcolor="#666666" align="center">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left" bordercolor="#999999" bgcolor="#000000"><img src="../IMG/member.jpg" width="548" /><br></td>
    <td bgcolor="#999999" valign="top" align="center" rowspan=13>&nbsp;
		
    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>
    	<table width="100%" border="1" bordercolor="#cccccc" cellpadding="0" bgcolor="#999999">
    		<form name="form" id="form" method="post" action="#" onSubmit="return checkform(this)">
			<!--Get DATA-->
		<% do while not rsUsers.EOF %>
    		<tr>
        		<td class="td1" width="23%" align="right">First Name:</td>
           		<td class="td2" width="77%"><%=rsUsers("FName")%></td>
        	</tr>
    		<tr>
        		<td class="td1" width="23%" align="right">Last Name:</td>
           		<td class="td2" width="77%"><%=rsUsers("LName")%>
                </td>
        	</tr>
           	<tr>
        		<td class="td1" width="23%" align="right">Email:</td>
           		<td class="td2" width="77%"><%=rsUsers("Email")%>
            	</td>
        	</tr>

      
    		<tr>
        		<td class="td1" width="23%" align="right">Password:</td>
           		<td class="td2" width="77%"><%=rsUsers("Password")%>
                </td>
        	</tr>
        	<tr>
        		<td class="td1" width="23%" align="right">Country:</td>
           		<td class="td2" width="77%"><%=rsUsers("Country")%>
         	   </td>
        	</tr>
	        <tr>
    	    	<td class="td1" width="23%" align="right">Telephone:</td>
        	   	<td class="td2" width="77%"><%=rsUsers("Telephone")%>
                </td>
        	</tr>
        	<tr>
        		<td class="td1" width="23%" align="right">Mobile:</td>
           		<td class="td2" width="77%"><%=rsUsers("Mobile")%>
                </td>
        	</tr>
	    	<tr>
    	    	<td class="td1" width="23%" align="right">Company:</td>
        	   	<td class="td2" width="77%"><%=rsUsers("Company")%>
                </td>
        	</tr>
    		<tr valign="top">
        		<td class="td1" width="23%" align="right">Address:</td>
           		<td class="td2" width="77%"><%=rsUsers("Address")%></td>
        	</tr>
    		<tr valign="top">
        		<td class="td1" width="23%" align="right">Activate:</td>
           		<td class="td2" width="77%"><input type="radio" name="Activate" id="Yes"/>&nbsp;YES&nbsp;&nbsp;<input type="radio" name="Activate" id="No" />NO</td>
        	</tr>
            
	        <tr>
        		<td class="td" width="23%" align="right">&nbsp;</td>
           		<td width="77%"><input name="Submit" type="submit" value="UPDATE" onclick="return checkform();" />&nbsp;
                <input name="Delete" type="submit" value="DELETE" onclick="return checkform();" />
                </td>
        	</tr>
			


        </form>
        
       <% rsUsers.MoveNext %>
<%loop %><!--Next Row-->
    </table>

Open in new window


Dear EE experts,

Kindly see the attached embed script (same embed script from our another open thread, but different topic). We would like to ask on how to add an action for the Activate part... after activating the user, the status of the user from the MySql db should be change from "0" to "1".
At this moment, every new users, its status is set to "0", once activated, it will be changed to "1", so they can login.

Hope to hear soon...

Thank you!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Developer & EE Moderator
Fellow 2018
Most Valuable Expert 2013
Commented:
<%
If request.form("UpdateRecord")<>"" then
	'Place your UPDATE script here
end if
If request.form("UpdateRecord")<>"" then
	'Place your DELETE script here
end if
%>
<head>
</head>

<body bgproperties="fixed" bgcolor="#000000" onLoad="javascript:startmenu()">



<%
	Dim myConnection
	Dim rsUsers
	Dim connectString
	Dim sqlString
	Dim requestName

	connectString = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=DBSERVER; PORT=3306; DATABASE=DB; USER=DBUSER; PASSWORD=DBPW; OPTION=0;"

	Set myConnection = Server.CreateObject("ADODB.Connection")
	Set rsUsers = Server.CreateObject("ADODB.Recordset")

	myConnection.Open connectString

	requestName = Request.Form("USERID")
	response.Write(requestName)

	sqlString = "Select * From users WHERE ID = 1"
	
	Set rsUsers = myConnection.Execute(sqlString)

%>

<table width="760" border="0" cellspacing="3" cellpadding="1">
  <tr>
    <td width="134"><img src="../IMG/logo_res.jpg" alt="STIEBEL ELTRON" /></td>
    <td width="620" valign="top" bgcolor="#666666"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="548" height="197">
      <param name="movie" value="homeintro20.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <embed src="homeintro20.swf" quality="high" wmode="opaque" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="548" height="197"></embed>
    </object></td>
    <td width="134" bgcolor="#FFFFFF"><img src="../IMG/RegIcon.png" alt="ASIA" border="0" align="top"/></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="right" bgcolor="#999999"><font face="Verdana, Geneva, sans-serif" color="#ffffff">
    <%
   '// If user is logged in show name and logout link
   If Session("loggedin") = true Then
      Response.Write "Welcome: " & Session("FName")
      Response.Write "<br /><a href=""../asia2/login/logout.asp"">Logout</a>"
   Else
      Response.Write "<a href=""../ste-iphoto-login2.asp"" title=""CLICK TO LOGIN"">REGISTERED USERS</a>"
   End If
	%>&nbsp;
	</td>
    <td bgcolor="#666666" align="center">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="left" bordercolor="#999999" bgcolor="#000000"><img src="../IMG/member.jpg" width="548" /><br></td>
    <td bgcolor="#999999" valign="top" align="center" rowspan=13>&nbsp;
		
    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>
    	
    	<table width="100%" border="1" bordercolor="#cccccc" cellpadding="0" bgcolor="#999999">
    		
			<!--Get DATA-->
		<% do while not rsUsers.EOF %>
    		<tr>
        		<td class="td1" width="16%" align="right">First Name:</td>
           		<td colspan="2" class="td2"><%=rsUsers("FName")%></td>
        	</tr>
    		<tr>
        		<td class="td1" width="16%" align="right">Last Name:</td>
           		<td colspan="2" class="td2"><%=rsUsers("LName")%>
                </td>
        	</tr>
           	<tr>
        		<td class="td1" width="16%" align="right">Email:</td>
           		<td colspan="2" class="td2"><%=rsUsers("Email")%>
            	</td>
        	</tr>

      
    		<tr>
        		<td class="td1" width="16%" align="right">Password:</td>
           		<td colspan="2" class="td2"><%=rsUsers("Password")%>
                </td>
        	</tr>
        	<tr>
        		<td class="td1" width="16%" align="right">Country:</td>
           		<td colspan="2" class="td2"><%=rsUsers("Country")%>
         	   </td>
        	</tr>
	        <tr>
    	    	<td class="td1" width="16%" align="right">Telephone:</td>
        	   	<td colspan="2" class="td2"><%=rsUsers("Telephone")%>
                </td>
        	</tr>
        	<tr>
        		<td class="td1" width="16%" align="right">Mobile:</td>
           		<td colspan="2" class="td2"><%=rsUsers("Mobile")%>
                </td>
        	</tr>
	    	<tr>
    	    	<td class="td1" width="16%" align="right">Company:</td>
        	   	<td colspan="2" class="td2"><%=rsUsers("Company")%>
                </td>
        	</tr>
    		<tr valign="top">
        		<td class="td1" width="16%" align="right">Address:</td>
           		<td colspan="2" class="td2"><%=rsUsers("Address")%></td>
        	</tr>
    		<tr valign="top">
        		<td class="td1" width="16%" align="right">Activate:</td>
           		<td width="25%" rowspan="2" class="td2">
                <form>
                <table width="130" border="0" cellspacing="0" cellpadding="1">
           		  <tr>
           		    <th width="128" scope="col"><input type="radio" name="Activate" id="Yes"/>
           		      YES
           		      <input type="radio" name="Activate" id="No" />
           		      NO</th>
       		      </tr>
           		  <tr>
           		    <td align="center"><input name="UpdateRecord" type="hidden" id="CurrentRecord" value="<%=CurrentRecordID%>">           		      <input name="Submit" type="submit" value="UPDATE" onClick="return checkform();" /></td>
       		      </tr>
       		    </table>    
                </form>
                       		  &nbsp;</td>
           		<td width="59%" rowspan="2" class="td2">
                <form id="frmDelete">
                <table width="130" border="0" cellspacing="0" cellpadding="1">
           		  <tr>
           		    <th width="128" scope="col"><input name="DeleteRecord" type="hidden" id="CurrentRecord" value="<%=CurrentRecordID%>"></th>
       		      </tr>
           		  <tr>
           		    <td align="center"><input name="Submit" type="submit" value="Delete"  /></td>
       		      </tr>
       		    </table>
                </form>
                </td>
        	</tr>
            
	        <tr>
        		<td class="td" width="16%" align="right">&nbsp;</td>
       		</tr>
			


        </form>
        
       <% rsUsers.MoveNext %>
<%loop %><!--Next Row-->
</table>

Open in new window

Author

Commented:
Sorry for the delayed response, because out of office, anyway, we would like to give u points now then will open a new thread regarding this matter.

Thank you!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial