Good morning,

I have created a registration page with a few little things built in to eliminate duplicate users. I am getting the follow error after clicking the register button:

cannot find 'file://C:/CTGR/_access/%3C%=MM_editAction%%3E'. Make sure the path or Internet address is correct.

Ideas on how to get this error to disappear and submitt correctly? Thank you in advance.

registration.asp source code:

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/connection.asp" -->
<%
' *** Edit Operations: declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Redirect if username exists
MM_flag="MM_insert"
If (CStr(Request(MM_flag)) <> "") Then
  MM_dupKeyRedirect="sorry.asp"
  MM_rsKeyConnection=MM_connection_STRING
  MM_dupKeyUsernameValue = CStr(Request.Form("txt_user_name"))
  MM_dupKeySQL="SELECT User_Name FROM website_users WHERE User_Name='" & Replace(MM_dupKeyUsernameValue,"'","''") & "'"
  MM_adodbRecordset="ADODB.Recordset"
  set MM_rsKey=Server.CreateObject(MM_adodbRecordset)
  MM_rsKey.ActiveConnection=MM_rsKeyConnection
  MM_rsKey.Source=MM_dupKeySQL
  MM_rsKey.CursorType=0
  MM_rsKey.CursorLocation=2
  MM_rsKey.LockType=3
  MM_rsKey.Open
  If Not MM_rsKey.EOF Or Not MM_rsKey.BOF Then 
    ' the username was found - can not add the requested username
    MM_qsChar = "?"
    If (InStr(1,MM_dupKeyRedirect,"?") >= 1) Then MM_qsChar = "&"
    MM_dupKeyRedirect = MM_dupKeyRedirect & MM_qsChar & "requsername=" & MM_dupKeyUsernameValue
    Response.Redirect(MM_dupKeyRedirect)
  End If
  MM_rsKey.Close
End If
%>
<%
' *** Insert Record: set variables

If (CStr(Request("MM_insert")) = "fmregister") Then

  Session("MM_User_Name") = Request("txt_user_name")
  Session(GreetingName") = Request("txt_first_name") & "" & Request("txt_middle_name") & "" & Request("txt_last_name")
  MM_editConnection = MM_connection_STRING
  MM_editTable = "website_users"
  MM_editRedirectUrl = "confirm_registration.asp"
  MM_fieldsStr  = "txt_first_name|value|txt_middle_name|value|txt_last_name|value|txt_user_name|value|txt_password|value|txt_email|value|txt_dob|value"
  MM_columnsStr = "First_Name|',none,''|Middle_Name|',none,''|Last_Name|',none,''|User_Name|none,none,NULL|Password|',none,''|Email|',none,''|Dob|',none,NULL"

  ' create the MM_fields and MM_columns arrays
  MM_fields = Split(MM_fieldsStr, "|")
  MM_columns = Split(MM_columnsStr, "|")

  ' set the form values
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
  Next

  ' append the query string to the redirect URL
  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
      MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End If
  End If

End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it

Dim MM_tableValues
Dim MM_dbValues

If (CStr(Request("MM_insert")) <> "") Then

  ' create the sql insert statement
  MM_tableValues = ""
  MM_dbValues = ""
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal = MM_fields(MM_i+1)
    MM_typeArray = Split(MM_columns(MM_i+1),",")
    MM_delim = MM_typeArray(0)
    If (MM_delim = "none") Then MM_delim = ""
    MM_altVal = MM_typeArray(1)
    If (MM_altVal = "none") Then MM_altVal = ""
    MM_emptyVal = MM_typeArray(2)
    If (MM_emptyVal = "none") Then MM_emptyVal = ""
    If (MM_formVal = "") Then
      MM_formVal = MM_emptyVal
    Else
      If (MM_altVal <> "") Then
        MM_formVal = MM_altVal
      ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & ","
      MM_dbValues = MM_dbValues & ","
    End If
    MM_tableValues = MM_tableValues & MM_columns(MM_i)
    MM_dbValues = MM_dbValues & MM_formVal
  Next
  MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"

  If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    If (MM_editRedirectUrl <> "") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If

End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Financial Learning Center - provided by REDW Stanley Financial Advisors</title>
<link href="../_css/base.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="3" class="masthead">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3" class="masthead_bottom">
<!--Start Quick Links-->
<!--Locked Conent-->        
        <form name="form1">
          <div align="right">
            <select name="select1" size="1" style="background-color:#FFFFFF" onChange="displaydesc(document.form1.select1, thetext1, 'textcontainer1')">
              <option>&raquo;Quick Links</option>           
              <option value="level_1/level_1a.htm">Level 1</option>
              <option value="level_2/level_2a.htm">Level 2</option>
              <option value="level_3/level_3a.htm">Level 3</option>
              <option value="level_4/level_4a.htm">Level 4</option>
              <option value="_contact/contact.asp">Contact</option>
            </select>
              <input type="button" value="Go" onClick="jumptolink(document.form1.select1)"> 
            <span id="textcontainer1" align="left">          </span>          </div>
        </form>
<!--End Quick Links-->   </td>
  </tr>
  <tr>
    <td width="134" valign="top" class="nav"><table width="100" border="0" cellspacing="0" cellpadding="3">

      <tr>
        <td width="18"><div align="center"><a href="../_contact/about.htm"><img src="../_images/arrow.jpg" width="18" height="16" border="0" /></a></div></td>
        <td width="76"><a href="../_contact/about.htm">ABOUT</a></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><a href="../_contact/modules.htm"></a></td>
      </tr>
      <tr>
        <td><div align="center"><a href="../_contact/tools.htm"></a><a href="../_contact/modules.htm"><img src="../_images/arrow.jpg" width="18" height="16" border="0" /></a></div></td>
        <td><a href="../_contact/modules.htm">MODULES</a><a href="../_contact/tools.htm"></a></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><a href="../_contact/contact.htm"></a></td>
      </tr>
      <tr>
        <td><div align="center"><a href="../_contact/tools.htm"><img src="../_images/arrow.jpg" width="18" height="16" border="0" /></a></div></td>
        <td><a href="../_contact/tools.htm">TOOLS</a></td>
      </tr>
      <tr>
        <td><a href="../_contact/tools.htm"></a></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td><div align="center"><a href="../_contact/contact.asp"><img src="../_images/arrow.jpg" width="18" height="16" border="0" /></a></div></td>
        <td><a href="../_contact/contact.asp">CONTACT</a></td>
      </tr>
      <tr>
        <td><a href="../_contact/contact.htm"></a></td>
        <td>&nbsp;</td>
      </tr>
    </table>    
    <p align="left">&nbsp;</p></td>
    <td width="758" valign="top" class="content"><p align="left" class="h2">User Registration</p>
      <p align="left" class="content">In order to access the training modules you will need to register with this website. Please fill out the form below. </p>
      <form id="fmregister" name="fmregister" method="POST" action="<%=MM_editAction%>">
        <table width="100%" border="0" cellspacing="0" cellpadding="3">

          <tr>
            <td width="15%" class="content">First Name</td>
            <td width="85%" class="content">
              <input name="txt_first_name" type="text" id="txt_first_name" size="25" maxlength="25" />
            </td>
          </tr>
          <tr>
            <td class="content">Middle Name</td>
            <td class="content">
              <input name="txt_middle_name" type="text" id="txt_middle_name" size="25" maxlength="25" />
            </td>
          </tr>
          <tr>
            <td class="content">Last Name</td>
            <td class="content">
              <input name="txt_last_name" type="text" id="txt_last_name" size="25" maxlength="25" />
            </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td colspan="2" class="content"><strong>Access Details</strong></td>
          </tr>
          <tr>
            <td class="content">Username</td>
            <td class="content">
              <input name="txt_user_name" type="text" id="txt_user_name" size="6" maxlength="6" />
              * <em>(role number)</em> </td>
          </tr>
          <tr>
            <td class="content">
              <label>Password</label>
            </td>
            <td class="content">
              <input name="txt_password" type="password" id="txt_password" size="25" maxlength="25" />
              *</td>
          </tr>
          <tr>
            <td class="content">
              <label>Email Address</label>
            </td>
            <td class="content">
              <input name="txt_email" type="text" id="txt_email" size="25" maxlength="25" />
            </td>
          </tr>
          <tr>
            <td class="content">Date of Birth</td>
            <td class="content">
              <input name="txt_dob" type="text" id="txt_dob" size="10" maxlength="10" />
* <em>(dd/mm/yyyy) </em></td>
          </tr>
          <tr>
            <td colspan="2" class="content">
              <label><em>note: * required fields </em></label>
            </td>
          </tr>
        </table>
        <label></label>
                  <p>
                    <label></label>
                    <label></label>
                    <label></label>
                    <label></label>  
                    <label></label><label>
                    <input name="reset" type="submit" id="reset" value="Clear" />
                    </label>
                    <label>
                    <input type="submit" name="Submit" value="Register" />
                    </label>
        </p>

                  <input type="hidden" name="MM_insert" value="fmregister">
</form>      
      <label></label>
      <p align="left">&nbsp;</p>    </td>
    <td width="8" class="right">&nbsp;</td>
  </tr>
  <tr>
    <td height="51" colspan="3" class="bottom"><div align="center">Copyright and disclaimer to be inserted at a later date. </div></td>
  </tr>
</table>
</body>
<!--Start Quick Links Javascript-->
<script type="text/javascript">
function displaydesc(which, descriptionarray, container){
if (document.getElementById)
document.getElementById(container).innerHTML=descriptionarray[which.selectedIndex]
}

function jumptolink(what){
var selectedopt=what.options[what.selectedIndex]
if (document.getElementById && selectedopt.getAttribute("target")=="newwin")
window.open(selectedopt.value)
else
window.location=selectedopt.value
}

displaydesc(document.form1.select1, thetext1, 'textcontainer1')
</script>
<!--End Quick Links Javascript-->
</html>

First, when u click submit button, ur MM_editAction is going back to the same pages and it didnt provide parameter at the end URL.
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))

Second, you didnt put any variable to Request.QueryString.
If (Request.QueryString <> "") Then is not produce any value in if statement

please check this few line in ur coding
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.