SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2004
    Location
    UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Managing Users with PHP Sessionsn and MySQL

    Hi

    My web site uses PHP sessiosn to manage users. My site is basically a dynamic site that contains a large number of pictures. Users must be registered and logged in to use my indexing system and view the pictures.

    However, what can I do to stop users typing the address of the pictures directly into the navigation bar?? I.e (http://www.mysite.com/content/todays...s/example1.jpg) instead of using my site after logging in.

    Once they know the path to my content directory they could just guess picture names by incrementing the filename.

    I know you can lock directories with .htaccess but I don't want users to have to log in twice?

    Any ideas?

    Thanks very much

    Estella

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    around
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when upload, store record in db with id int, name etc. then create a php script that take a id in the url and gets filename from db and send headers and display image. then use .htaccess to block the directory and use the php script to display the images always

  3. #3
    SitePoint Member
    Join Date
    Aug 2004
    Location
    UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I block the directory with .htaccess will that will stop the users browser from accessing the images?? (won't it?) I do currently use a database with stores the names of images and there location. Then I can build up pages of pictures using PHP. The PHP writes <img src"xxx/xxx/xx.jpg"> to the users browser. The. htaccess would stop this from working?

    Or am I missing teh point completely?? Because you mention "headers". I don't really know much about headers.

    Sorry if I sound a bit lost.

    Thanks

    Estella

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    around
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    your table with images have a id field?


Bookmarks

Posting Permissions

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