steevg wrote:Kudose,
hey thanks for that.
So . . . . my understanding of php (from reading some of the other posts here) is that ANY php code HAS to go at the top BEFORE the html . . . .. is that correct?
No. Any code that requires headers to be sent (the header function for example), must be called and run before output is sent to the browser. You can put PHP code in the middle of your HTML as long as you dont send additional page headers (session info, headers, etc . . .).
You would use a regular anchor link in your PDF, linking to your website. So when someone clicks a link in your PDF, it pop's open a browser and takes them to the designated URL.
You're not actually "redirecting" in your PDF ... you're just linking. A redirect is when you go to mywebsite.com but end up at mywebsite.net. to do that, you either use the [man]header[/man] function or a META refresh.
Like you mentioned, the best route to link TO the PDF, would be to create a normal link to targetsite.php and in that file, redirect to download the PDF (using a [man]header[/man]).
Also, just as an FYI ... most Apache setup's need the page extension to be PHP, PHP3, or PHTML for Apache to interpet the code. Not targetsite.html.
If I confused you more, let me know and I can try again.
🙂