Page 1 of 1

redirect

Posted: Fri Apr 15, 2011 6:42 am
by Anant
Hi,

There is a url in the email - when user clicks on it, it downloads the pdf and exit. But i want it to redirect to home page of the site after download is finished.

I have tried placing

Code: Select all

header("Location: http://www.xyz.com");
in the end of the script but then it just directly redirect to xyz.com without downloading the pdf.

Any suggestion ??

Re: redirect

Posted: Fri Apr 15, 2011 12:58 pm
by techkid
HTML can do that.

Code: Select all

<a href="filename.pdf" onclick="window.open('http://google.com/')">Download PDF</a>
You can include this code in emails. Replace the file.pdf with your pdf file location and http://google.com with the site homepage. \

This will download the pdf file and opens a new tab in the browser and loads the homepage at the same time.