Force download to specific window

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
lordrain11
Forum Newbie
Posts: 8
Joined: Wed Nov 19, 2008 7:33 pm

Force download to specific window

Post by lordrain11 »

I have some code that forces a download of a pdf file whent the user clicks a link. My issues is that it puts it in my current window so when the user is done with the pdf if they close it they have left the site. I really want the pdf to either open directly in acrobat or in a new browser window. I have heard that I can't control that with php so I tried another approach... When the user clicks the link it opens in a new window (Target _blank) which processes the code to force the pdf download. Problem is this new window is blank and the pdf opens in the orginal window. Is there a way to chnage which is the "parent" window or something so that it opens in the perfectly good blank window and leaves the orginal website alone? Perhaps it has to be javascript, I am open to all suggestions, thanks.
redfox16
Forum Newbie
Posts: 3
Joined: Sat Dec 13, 2008 11:37 am

Re: Force download to specific window

Post by redfox16 »

aha your from phpfreaks too
Post Reply