Forum Moderators: coopster

Message Too Old, No Replies

Form submit/start download

         

geoffb

9:10 am on Jan 12, 2010 (gmt 0)

10+ Year Member



Hi,

I need to get a 2 field form submitted to an email address as usual, and at the same time the button is clicked to send email a Zip file is downloaded and can then be opened.

Any ideas?

Cheers
geoffb

Psychopsia

2:44 pm on Jan 12, 2010 (gmt 0)

10+ Year Member



I get lost on last words...

Do you want to:

1) Send email with ZIP as attachment?
2) Send text email and then ZIP download to browser to save as...?

geoffb

2:58 pm on Jan 12, 2010 (gmt 0)

10+ Year Member



yes, I want to submit a form with 2 fields, name and email then when user clicks the send button the form is sent to an email and at the sametime download box opens to save zip file or open ect ect...

Cheers

rocknbil

9:33 pm on Jan 12, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1. Submit the form.

2. Print response.

echo "Thank you for your information, your download should start shortly. If it does not, <a href=\"/path/to/file.zip\">download here</a>.";

3. Immediately after the response, do a header:

header("Location:/path/to/file.zip");

That should work.