redirect

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Anant
Forum Commoner
Posts: 66
Joined: Wed Jul 14, 2010 11:46 am

redirect

Post 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 ??
User avatar
techkid
Forum Commoner
Posts: 54
Joined: Sat Sep 05, 2009 11:18 pm
Location: Maldives

Re: redirect

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