<% Dim MM_editAction 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 Dim MM_abortEdit MM_abortEdit = false %> <% ' *** Redirect if username exists MM_flag = "MM_insert" If (CStr(Request(MM_flag)) <> "") Then Dim MM_rsKey Dim MM_rsKey_cmd MM_dupKeyRedirect = "nameTaken.html" MM_dupKeyUsernameValue = CStr(Request.Form("userName")) Set MM_rsKey_cmd = Server.CreateObject ("ADODB.Command") MM_rsKey_cmd.ActiveConnection = MM_connWeekendMusician_STRING MM_rsKey_cmd.CommandText = "SELECT userName FROM users WHERE userName = ?" MM_rsKey_cmd.Prepared = true MM_rsKey_cmd.Parameters.Append MM_rsKey_cmd.CreateParameter("param1", 200, 1, 50, MM_dupKeyUsernameValue) ' adVarChar Set MM_rsKey = MM_rsKey_cmd.Execute 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 %> <% ' IIf implementation Function MM_IIf(condition, ifTrue, ifFalse) If condition = "" Then MM_IIf = ifFalse Else MM_IIf = ifTrue End If End Function %> <% If (CStr(Request("MM_insert")) = "form2") Then If (Not MM_abortEdit) Then ' execute the insert Dim MM_editCmd Set MM_editCmd = Server.CreateObject ("ADODB.Command") MM_editCmd.ActiveConnection = MM_connWeekendMusician_STRING MM_editCmd.CommandText = "INSERT INTO users (address, city, firstName, lastName, [state], userName, userPassword, zipCode) VALUES (?, ?, ?, ?, ?, ?, ?, ?)" MM_editCmd.Prepared = true MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 50, Request.Form("address")) ' adVarWChar MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 50, Request.Form("city")) ' adVarWChar MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 50, Request.Form("firstName")) ' adVarWChar MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 50, Request.Form("lastName")) ' adVarWChar MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202, 1, 50, Request.Form("state")) ' adVarWChar MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 202, 1, 50, Request.Form("userName")) ' adVarWChar MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 202, 1, 50, Request.Form("userPassword")) ' adVarWChar MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 5, 1, -1, MM [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Nevermynd [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> can you combine 2 actions? - Macromedia Dynamic HTML

can you combine 2 actions? - Macromedia Dynamic HTML

I am wondering is there a way to activate 2 actions at once when the submit button is pressed? I have a form that I have set up to send info to a database which is activated by this "<%=MM_editActions%>" but I also have another script in another asp page named "RegFormMailer.asp" that sends the form owner an email. But I only know how to do one or the other. Can I put TWO actions in the action field in dreamweavers property panel? Something like "<%=MM_editActions%>" + "RegFormMailer.asp"? Thank you, I am VERY new to dynamic site/and scripting. Just used ...

  1. #1

    Default can you combine 2 actions?

    I am wondering is there a way to activate 2 actions at once when the submit
    button is pressed?
    I have a form that I have set up to send info to a database which is activated
    by this "<%=MM_editActions%>"
    but I also have another script in another asp page named "RegFormMailer.asp"
    that sends the form owner an email.
    But I only know how to do one or the other.
    Can I put TWO actions in the action field in dreamweavers property panel?
    Something like "<%=MM_editActions%>" + "RegFormMailer.asp"?

    Thank you, I am VERY new to dynamic site/and scripting. Just used to static
    sites.

    Nevermynd Guest

  2. #2

    Default Re: can you combine 2 actions?

    ..oO(Nevermynd)
     

    One form, one action. Of course you can do whatever you want in the
    processing script.
     

    No. You have to combine them both on the server.

    Micha
    Michael Guest

  3. #3

    Default Re: can you combine 2 actions?

    Michael, (or anyone) when you say I have to combine them on the server, can you
    elaborate a bit? I am very new to server application web design.

    Do you mean, put both tasks all in one script? I actually did try combining
    them, and it ALMOST works.
    It successfully sends the form info to the data base AND it sends an email to
    the form owner, the only problem is the inputed info is missing in the email...
    Like this......

    First Name:
    Last Name:
    Address:
    City:
    State:
    User Name:
    Password:

    Would someone perhaps be willing to look at my code and see if they can make
    both tasks work completely?
    Thank you!
    Ken



    Home /Support /Forums /Dreamweaver Support Forums / Dreamweaver Application
    Development 0 new messages

    Home New Topic Profile Logout My Forums Search Help
    04:33:28 PM Refresh
    There are currently 45 users logged in.

    FORUMS : Dreamweaver Application Development
    rss feed
    Other Dreamweaver Support Forums Dreamweaver General Discussion Dynamic HTML
    General Discussion Dreamweaver Application Development Dreamweaver Extensions
    Private Topics

    Topic Title 2 actions on one form possible?
    Topic Summary
    Created On 03/16/2008 06:54:35 AM
    Topic View Linear Threading Single Branch
    Quick Reply
    Subscribe to this topic
    E-mail this topic to someone
    Add this topic to my forum favorites
    View topic in raw text format

    Posted By Post
    Nevermynd
    User is online

    Member Posts: 56
    Joined: 03/16/2006
    Send Private Message
    03/16/2008 06:54:35 AM
    Reply | Quote | Top | Bottom | Edit

    I am a newbie to creating dynamic web sites and am wondering if you can have
    more than one action attached to the action field in the properties panel in
    dreamweaver?

    In other words I want 2 things to happen when the submit button is pressed.
    One action submits the form data to the data base and the other action sends an
    email to the web site owner notifying him of the newly registered person along
    with their info.

    One action is "<%=MM_editAction> " and the other is simply "test.asp" (which
    obviously refers to another asp page to relay the code.

    So can I combine those two actions somehow?
    Thank you!
    Ken


    Mark this message as the answer.
    Print this message
    Report this to a Moderator
    Newsgroup User

    Murray *ACE* 03/16/2008 01:07:22 PM
    Reply | Quote | Top | Bottom

    Sure. Add the data to the database in the test.asp page. In other words,
    combine the two.

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
    ==================


    "Nevermynd" <com> wrote in message
    news:fricmr$n2k$macromedia.com... 




    Mark this message as the answer.
    Print this message
    Report this to a Moderator
    Newsgroup User

    Julian Roberts 03/16/2008 05:11:05 PM
    Reply | Quote | Top | Bottom

    In the Insert script, change Response.Redirect to Server.Transfer

    --
    Jules
    http://www.charon.co.uk/products.aspx
    Charon Cart
    Ecommerce for ASP/ASP.NET


    "Nevermynd" <com> wrote in message
    news:fricmr$n2k$macromedia.com... 





    Mark this message as the answer.
    Print this message
    Report this to a Moderator
    Nevermynd
    User is online

    Member Posts: 56
    Joined: 03/16/2006
    Send Private Message
    03/16/2008 08:48:44 PM
    Reply | Quote | Top | Bottom | Edit

    Thanks for the help guys, like I said I am new to this dynamic stuff and don't
    know much about the coding YET.
    Heres basically what I have:

    An ASP page (RegForm.asp) with the form in it and all the code to submit the
    entered into to an .mdb file. The action on this page is "<%=MM_editAction> "
    This is currently in use and functioning properly.

    Now, I also have a seperate ASP page(RegFormMailer.asp), that is set up to
    take the forms info from "RegForm.asp" and send an email of the info to the
    form owner. I wish to add this new ASP page/function to the equation.

    First I am wondering, am I able to do that JUST by puting 2 actions together
    in the action field of RegFormMailer.asp in dreamweaver?
    Something like "%=MM_editAction>;RegFormMailer.asp" ?

    If not....then it sounds like I need to take the database coding embedded in
    the RegForm.asp file and cut and paste it into the RegFormMailer.asp file? Then
    the only action I would need in the action field of RegForm.asp is
    "RegFormMailer.asp" , correct?

    Please remember....I am a newbie so need some hand holding!
    Thank you!
    Ken


    Mark this message as the answer.
    Print this message
    Report this to a Moderator
    Nevermynd
    User is online

    Member Posts: 56
    Joined: 03/16/2006
    Send Private Message
    03/16/2008 09:50:09 PM
    Reply | Quote | Top | Bottom | Edit

    Ok, I think I am closer, but not there yet.
    I went ahead and combined the code from the 2 asp pages into one page.
    So now...when the viewer fills out the form the info is successfully
    transmitted to a database....as before.
    An email is also sent to the form owner successfully, the only problem is the
    email only contains the form labels and NOT the inputed information.
    Like this:

    address :
    city :
    firstName :
    lastName :
    state :
    userName :
    userPassword :
    zipCode :
    submitFormBtn :
    MM_insert :

    I have included the code for the whole asp page...could someone take a look
    and let me know what is needed for the inputed info to appear? The code for the
    form email is in the lower 1/3 of the page.
    Thank you!!
    Attach Code

    <%LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!--#include file="Connections/connWeekendMusician.asp" -->
    <%
    Dim MM_editAction
    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
    Dim MM_abortEdit
    MM_abortEdit = false
    %>
    <%
    ' *** Redirect if username exists
    MM_flag = "MM_insert"
    If (CStr(Request(MM_flag)) <> "") Then
    Dim MM_rsKey
    Dim MM_rsKey_cmd

    MM_dupKeyRedirect = "nameTaken.html"
    MM_dupKeyUsernameValue = CStr(Request.Form("userName"))
    Set MM_rsKey_cmd = Server.CreateObject ("ADODB.Command")
    MM_rsKey_cmd.ActiveConnection = MM_connWeekendMusician_STRING
    MM_rsKey_cmd.CommandText = "SELECT userName FROM users WHERE userName = ?"
    MM_rsKey_cmd.Prepared = true
    MM_rsKey_cmd.Parameters.Append MM_rsKey_cmd.CreateParameter("param1", 200,
    1, 50, MM_dupKeyUsernameValue) ' adVarChar
    Set MM_rsKey = MM_rsKey_cmd.Execute
    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
    %>
    <%
    ' IIf implementation
    Function MM_IIf(condition, ifTrue, ifFalse)
    If condition = "" Then
    MM_IIf = ifFalse
    Else
    MM_IIf = ifTrue
    End If
    End Function
    %>
    <%
    If (CStr(Request("MM_insert")) = "form2") Then
    If (Not MM_abortEdit) Then
    ' execute the insert
    Dim MM_editCmd

    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_connWeekendMusician_STRING
    MM_editCmd.CommandText = "INSERT INTO users (address, city, firstName,
    lastName, [state], userName, userPassword, zipCode) VALUES (?, ?, ?, ?, ?, ?,
    ?, ?)"
    MM_editCmd.Prepared = true
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1,
    50, Request.Form("address")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1,
    50, Request.Form("city")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1,
    50, Request.Form("firstName")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1,
    50, Request.Form("lastName")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202, 1,
    50, Request.Form("state")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 202, 1,
    50, Request.Form("userName")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 202, 1,
    50, Request.Form("userPassword")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 5, 1,
    -1, MM
    Nevermynd Guest

  4. #4

    Default Re: can you combine 2 actions?

    ..oO(Nevermynd)
     

    Yes, that's what I meant. Your script can do a hundred tasks if
    necessary. I just can't help you with ASP code (I'm on PHP).

    Micha
    Michael Guest

Similar Threads

  1. combine pages
    By littlez@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 5
    Last Post: November 9th, 05:01 PM
  2. Combine Databases
    By rokit1313 in forum Coldfusion Database Access
    Replies: 5
    Last Post: October 11th, 04:55 PM
  3. Combine CSV files
    By s6868 in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: April 22nd, 08:44 PM
  4. is it possible to combine jsp and php?
    By Blah Blah in forum PHP Development
    Replies: 7
    Last Post: November 19th, 11:17 PM
  5. Actions - loading actions by opening .atn action file
    By Danny Raphael in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 8
    Last Post: September 1st, 05:34 PM

Bookmarks

Posting Permissions

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