logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > ASP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 07-07-2008, 06:23 AM   #1
rico1931
 
Join Date: Jun 2008
Location: Buffalo
Posts: 198
Default Passing variables from child window to parent window

howdy there folks if you have read my previous post on sessions variables I apologize for the re post of this but I thought this was appropriate since its a different problem.

So I would like to know the best possible way to manipulate the DW code of the login behavior they have in CS3. The following is a login function that opens in a small 200x200 window from a link on the parent page and all I want to do is have once the submit button is pressed on the form to pass all the variabes to the parent window that would be open in the back. I have posted the login auth code and form.. thaks for any tips you give me on manipulating this code. I'm thinking this can be done but it prob means not using the login code DW provides and hand doing this my self which I complete understand but any help would or ideas would be nice.

Login Authorization code
Code:
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername = CStr(Request.Form("Email"))
If MM_valUsername <> "" Then
  Dim MM_fldUserAuthorization
  Dim MM_redirectLoginSuccess
  Dim MM_redirectLoginFailed
  Dim MM_loginSQL
  Dim MM_rsUser
  Dim MM_rsUser_cmd
  
  MM_fldUserAuthorization = "AUTH_LEVEL"[/COLOR]
  MM_redirectLoginSuccess = "/SessionID2.asp"
  [COLOR="rgb(46, 139, 87)"]MM_redirectLoginFailed = "/Default.asp"

  MM_loginSQL = "SELECT AUTH_EMAIL, AUTH_PW"
  If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
  MM_loginSQL = MM_loginSQL & " FROM dbo.AUTH WHERE AUTH_EMAIL = ? AND AUTH_PW = ?"
  Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
  MM_rsUser_cmd.ActiveConnection = MM_DMICSQL_STRING
  MM_rsUser_cmd.CommandText = MM_loginSQL
  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 50, MM_valUsername) ' adVarChar
  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 50, Request.Form("Password")) ' adVarChar
  MM_rsUser_cmd.Prepared = true
  Set MM_rsUser = MM_rsUser_cmd.Execute

  If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then 
    ' username and password match - this is a valid user
    Session("MM_Username") = MM_valUsername
    If (MM_fldUserAuthorization <> "") Then
      Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
    Else
      Session("MM_UserAuthorization") = ""
    End If
    if CStr(Request.QueryString("accessdenied")) <> "" And true Then
      MM_redirectLoginSuccess = Request.QueryString("accessdenied")
    End If
    MM_rsUser.Close
    Response.Redirect(MM_redirectLoginSuccess)
  End If
  MM_rsUser.Close
  Response.Redirect(MM_redirectLoginFailed)
End If
%>
Login form code
Code:
<form id="form1" name="form1" method="POST" action="<%=MM_LoginAction%>">
        <label>Email:
          <input type="text" name="Email" id="Email" />
        </label>
        <br />
        <label>Password:
        <input type="text" name="Password" id="Password" />
        </label>
        <br />
        <input name="button" type="submit" id="button" value="Submit" />
      </form>
Thanks for the help.. remember its through the login behavior in DWcs3
Hope the Americans had a happy Fouth!!!!
rico1931 is offline   Reply With Quote
Old 08-12-2008, 10:11 AM   #2
student101
 
Join Date: Dec 2007
Posts: 379
Default

Here is what I googled, cool stuff this google thingy.

http://www.plus2net.com/javascript_t...dow-child3.php

http://dotnetslackers.com/Community/...ld-window.aspx

Cheers
__________________
Amateurs ... Built the ark.
Professionals ... Built the Titanic.
specificity [sound like spe-sifis-ity]
student101 is offline   Reply With Quote
Old 08-12-2008, 02:06 PM   #3
rico1931
 
Join Date: Jun 2008
Location: Buffalo
Posts: 198
Default

awesome thanks student101 i decided to take a dif approach and will consider this for next time. also yes google is a nice lil tool haha
rico1931 is offline   Reply With Quote
Old 09-15-2008, 07:28 AM   #4
student101
 
Join Date: Dec 2007
Posts: 379
Thumbs up

Anytime
__________________
Amateurs ... Built the ark.
Professionals ... Built the Titanic.
specificity [sound like spe-sifis-ity]
student101 is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:32 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com