Block access to url.

Discussion in 'PHP' started by Alan Murray, Nov 9, 2006.

  1. #1
    What would be the easiest way to block a URL being loaded after being entered in the URL bar?? It is for an html site that has a download page of an e book. I don’t want people downloaded it if they don’t pay.
     
    Alan Murray, Nov 9, 2006 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    How do you verify if they have paid or not? Do they get the link to the file after paying? You could give out unique download codes to each user to access the file... but please provide more information about your current system.
     
    nico_swd, Nov 9, 2006 IP
  3. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
    #3
    Do you build the site manually?
    Why don't you use the e-commerce scripts?
     
    Richie_Ni, Nov 9, 2006 IP
  4. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #4
    oscommerce can handle this.
     
    mad4, Nov 9, 2006 IP
  5. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Couple of simple options:

    - integrate semantic wikis
    - enable rss-capable networking
    - integrate A-list life-hacks
    - remix standards-compliant tagclouds

    Courtesy of Empty Bottle.

    Second time today I say this... Mad4 is spot on.
     
    T0PS3O, Nov 9, 2006 IP
  6. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
    #6
    Yes..here's the link [SIZE=-1]http://www.[/SIZE]oscommerce.com
    And it's free :)
     
    Richie_Ni, Nov 9, 2006 IP
  7. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Another solution I sometimes use is to use fpdf to generate a personalised copy of the pdf ebook and then auto email it to the customer.

    That way its not published on the web and if it is then you can trace the culprit pretty easily. ;)
     
    mad4, Nov 9, 2006 IP
  8. Alan Murray

    Alan Murray Well-Known Member

    Messages:
    1,044
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    145
    #8
    Thanks for the suggestions. FPDF looks good mad4 but it is for a clients website and don’t fancy teaching them to use it.

    I will be using paypal - I thought there is an easy method to block a url being loaded in the url bar?
     
    Alan Murray, Nov 9, 2006 IP
  9. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Yes, by having a unique reference in the URL which links to a database which tells you whether they paid or not.
     
    T0PS3O, Nov 9, 2006 IP
  10. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #10
    It all depends how sensitive and valuable your ebook is. If you have a randomly generated reference in a database with a 24 hour expiry then you should be safe for most purposes.
     
    mad4, Nov 9, 2006 IP
  11. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Although the suggestions already made are the best way to achieve what you need (although I'm not sure about TOPS30s' suggestion about semantic wikis and the like - that went over my head) to approach the problem slightly differently and address the question I think you are actually asking you can prevent a user typing in a link to your pdf (most of the time but it isn't 100%) by looking at the http referrer and only allowing access when the value is a page on your site.
     
    streety, Nov 9, 2006 IP
  12. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #12
    LOL I just got that.:eek: :)


    People who use Norton block referrer headers by default so this may not be a good idea.
     
    mad4, Nov 9, 2006 IP
  13. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Where's the downside? ;)

    Seriously though I agree that it isn't a good way of implementing what is needed in this situation. It does however answer the specific question asked. It's one of those situations where I think what Alan Murray thought he needed is different to what he actually needs.
     
    streety, Nov 9, 2006 IP
  14. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I thought the semantic wiki's one was obvious. Just follow that link in my post.
     
    T0PS3O, Nov 9, 2006 IP
  15. Alan Murray

    Alan Murray Well-Known Member

    Messages:
    1,044
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    145
    #15
    Well yes because I expected it to a simple line of code! Not sure best way because this is a small website with a client that has a very basic I.T skill level.
     
    Alan Murray, Nov 10, 2006 IP