dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Flash Login Form to Asp

  1. #1
    Junior Member
    Join Date
    Mar 2000
    Posts
    28
    I have a simple flash login form with 2 fields: company & uid. I want to send these 2 variable to an ASP script that queries a database and redirects the browser to another url. I used:

    on (release) {
    getURL ("login_asp.asp", "", "POST");
    }

    on the submit button.

    I've tried various ways of declaring the variable, but the asp script doesn't seem to be detecting these from flash. What am I missing?

    Just so no confusion, I want to leave the movie (it's only an intro with a login) so I don't need anything passed back to the Flash movie. But does the asp script need to be any different than if it's receiving variables from an html form?

    Bill

  2. #2
    Hack
    Join Date
    Mar 2000
    Location
    Madison, WI
    Posts
    1,753
    The post action sends all variables in ITS TIMELINE. If the variables exist on another timeline, they won't be sent.

  3. #3
    Junior Member
    Join Date
    Mar 2000
    Posts
    28

    only one scene and 1 frame

    There is only one scene with one frame and no movie clips

  4. #4
    Senior Member
    Join Date
    Dec 2000
    Posts
    120

    you haven't described all you're doing, so I can only guess...

    I use FLASH and ASP together a bit, and haven't had any problems.

    In you ASP code are you using Request.QueryString or Request.Form? With the POST action, you'll need Request.Form.

    if your variable in flash is MyVar then the syntax in ASP would be Request.Form("MyVar") knowing that case sensitivity is an issue.

    sorry if this is all stuff you know, but without seeing your code, I don't know what else to say...

  5. #5
    Junior Member
    Join Date
    Mar 2000
    Posts
    28

    sorry - here is asp

    <%

    Dim dsnSrg
    Dim userId
    Dim password
    Dim loginSql
    Dim loginRs
    Dim connLogin
    Dim logRs
    Dim logSql
    Dim company

    sub killObject()

    connLogin.Close
    Set connLogin = Nothing

    end sub

    dsnSrg = "lowen-furn"

    Set connLogin = Server.CreateObject("ADODB.connection")
    If Not IsObject(connLogin) Then
    Response.Write "Database is temporarily unavailable"
    Response.End
    End If

    connLogin.Open (dsnSrg)

    'On Error Resume Next

    company = Request.Form("company")
    userID = Request.Form("uid")

    logSql = "INSERT INTO user_log (log_uid, log_pw) VALUES ('" & userID & "','" & company &"')"
    Set logRs = connLogin.Execute(logSql)


    loginSql = "SELECT * FROM login WHERE userID = '" & userID & "'"
    Set loginRs = connLogin.Execute(loginSql)


    If loginRs.BOF Then
    Response.write ("<FONT SIZE='+1'><B>Lowen furniture-graphics.com Login Denied. Customer ID# is invalid. Please click your browsers back button and try again.</B></FONT>")
    killObject()
    Response.End
    End If


    If loginRs.Fields("userID") = userID Then
    Session("Authorization") = "true"
    Response.Redirect "main/index.asp"
    Else
    Response.write ("<FONT SIZE='+1'><B>Lowen furniture-graphics.com Login Denied. Customer ID# is invalid. Please click your browsers back button and try again.</B></FONT>")
    killObject()
    Response.End
    End If

    killObject()

    %>

    I inherited this and am real new to asp...

  6. #6
    Senior Member
    Join Date
    Dec 2000
    Posts
    120

    generally this looks OK.

    My next question would be if I could see your .fla

    I would guess what has been mentioned before which is that either your variable names in FLASH are wrong OR you don't have them on the timeline that does the send.

    I'm assuning you're using the full pathname to the .asp page.

    http://www.schnell.ca/testpass.html
    was done just to show you it does work as you've got it.

    The ASP Code:
    Code:
    <%@ LANGUAGE="VBScript" %>
    
    <%
       
    Response.Write "uid retreived as: '" & request.form("uid") & "'<br>" 
    Response.Write "password retreived as: '" & request.form("password") & "'<br>" 
    
    %>
    the FLASH Submit Button
    Code:
    on (release) {
        getURL ("http://www.schnell.ca/testpass.asp", "", "POST");
    }
    let me know what you find out.

  7. #7
    Senior Member
    Join Date
    Dec 2000
    Posts
    120

    oh and it you want them....

    here's my .fla
    http://www.schnell.ca/testpass.fla

    the asp page was exactly what I said in the last post.

  8. #8
    Junior Member
    Join Date
    Mar 2000
    Posts
    28

    Smile Hey, it worked!

    The only thing I had different from your file was in my .fla I had "html" checked in the "text options" tab area. Now it works, who can figure? Thanks much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center