SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2009
    0 Post(s)
    0 Thread(s)

    Wink How to generate link to PDF from current url

    I've looked on the forums and google for this, and I can't find anything exactly right:

    I have a universal navigation, one link is "Print PDF" - I don't want to hand code each page individually.

    How can I use the current page url - such as "" to print a PDF named after the page, like "accomodations.pdf", or even better "pdfs/accomodations.php"?

    OR just any way to print a PDF associated with the current page - I guess it doesn't necessarily need to be the URL that links the files.

    Thanks in advance for your help!

  2. #2
    SitePoint Guru downtroden's Avatar
    Join Date
    Dec 2004
    0 Post(s)
    0 Thread(s)
    not really javascript, but have you looked up regular expressions and mod_rewrite?

    You could have php build a url based on the current request and have apache redirect the 'fake' url to the appropriate pdf file based on variable values in the url string.
    your brain reacts in the same way whether you are
    looking at something or thinking about it...

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts