Calling PHP code

Discussion in 'JavaScript' started by PHPLOST, Nov 7, 2010.

  1. #1
    Is there a way to call PHP and how would one do it from javascript?

    I have javascript that is loading .jpg images and using lightbox to enlarge. I need to add a user download for each picture , I though I could add an object "button" in the javascript and reference the PHP piece for forcedown load but can not seem to get this to work.
     
    PHPLOST, Nov 7, 2010 IP
  2. bencummins

    bencummins Peon

    Messages:
    55
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You just need to make php navigate to download.php?file=xyz.jpg.... download php needs to force the download of the image.... in theory because its a file, the browser shouldn't redirect
     
    bencummins, Nov 8, 2010 IP