...

View Full Version : can i have multiple action in a form



anparasu
10-17-2005, 11:04 AM
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

glenngv
10-17-2005, 11:30 AM
The redirect code must be in the test/test/mail script. Have a hidden field to specify what page to redirect to.


<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.

anparasu
10-17-2005, 11:47 AM
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

glenngv
10-17-2005, 11:57 AM
What server-side language are you using? Can you show your code?

anparasu
10-17-2005, 12:08 PM
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;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum