Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow can i have multiple action in a form

    hi all

    i need three things to happen on a form submit at a same time.

    1. download
    2. sent mail.
    3. redirect to another page

    with the code below i can able to download and sent mail at a same time

    <form name="a" action="test/test/mail?test" method="post">
    <input type="hidden" name="from-email" value="a@a.com">
    <input type="hidden" name="next-url" value="download.exe">
    <input type="hidden" name="subject" value="test download">
    <input type="submit" value="Download" name="testdownload" title="fmdffppjk" class="button">
    </form>

    can anyone tell me how do i also redirect to another page on clicking the submit button.


    regards
    anbu

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    The redirect code must be in the test/test/mail script. Have a hidden field to specify what page to redirect to.

    Code:
    <input type="hidden" name="redirect" value="thanks.html" />
    Then in test/test/mail, read the content of that field and then redirect to that page after downloading and sending mail.

  • #3
    New Coder
    Join Date
    Jun 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi glenngv

    thanks for your response.

    <input type="hidden" name="next-url" value="download.exe">

    i have already given that for next-url to download the exe.

    on clicking the submit button i need to download the exe, sent mail and to the thanks page at same time.

    how do i do that.

    please help

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    What server-side language are you using? Can you show your code?

  • #5
    New Coder
    Join Date
    Jun 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    perl

    Following statements i had used to redirect to next-URL

    #### Now, redirect if "next-url" is included
    if ($FORM{'next-url'}) {
    print "Location: $FORM{'next-url'}\n";
    print "\n";
    exit;
    }

    1.) Is there any way i could use "Content-Disposition:attachment;" for file downloading ?

    2.) Whether i could use the following statements to start download the exe and then redirecting to next-url.

    print "Content-Disposition:attachment;filename=download.exe";

    #### Now, redirect if "next-url" is included
    if ($FORM{'next-url'}) {
    print "Location: $FORM{'next-url'}\n";
    print "\n";
    exit;
    }


  •  

    Posting Permissions

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